diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2006-10-04 20:28:41 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2006-10-04 20:28:41 (GMT) |
commit | ca720513ae89ad82fd8d8c4340271375ae1e9f64 (patch) | |
tree | d2526ce0c99b1f268769fd8bd1c56e6dda83fd7f /src/definition.cpp | |
parent | b1dbef9886c3bf49050a5f49b9ae9d12021e4b50 (diff) | |
download | Doxygen-ca720513ae89ad82fd8d8c4340271375ae1e9f64.zip Doxygen-ca720513ae89ad82fd8d8c4340271375ae1e9f64.tar.gz Doxygen-ca720513ae89ad82fd8d8c4340271375ae1e9f64.tar.bz2 |
Release-1.4.7-20061004
Diffstat (limited to 'src/definition.cpp')
-rw-r--r-- | src/definition.cpp | 88 |
1 files changed, 1 insertions, 87 deletions
diff --git a/src/definition.cpp b/src/definition.cpp index b837a37..3c00fbb 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -34,7 +34,6 @@ #include "section.h" #include "htags.h" #include "parserintf.h" -#include "objcache.h" #include "marshal.h" #if defined(_MSC_VER) || defined(__BORLANDC__) @@ -237,14 +236,11 @@ Definition::Definition(const char *df,int dl, const char *name,const char *b, const char *d,bool isSymbol) { - m_storagePos=-1; m_name = name; m_impl = new DefinitionImpl; m_impl->init(df,dl,name,b,d); m_isSymbol = isSymbol; if (isSymbol) addToMap(name,this); - m_cacheHandle=-1; - m_flushPending = FALSE; } Definition::~Definition() @@ -258,11 +254,6 @@ Definition::~Definition() delete m_impl; m_impl=0; } - if (m_cacheHandle!=-1) - { - Doxygen::symbolCache->del(m_cacheHandle); - m_cacheHandle=-1; - } } void Definition::addSectionsToDefinition(QList<SectionInfo> *anchorList) @@ -1173,74 +1164,14 @@ void Definition::setLocalName(const QCString name) } void Definition::makeResident() const -{ - if (m_cacheHandle==-1) // not yet in cache - { - Definition *victim = 0; - Definition *that = (Definition*)this; // fake method constness - that->m_cacheHandle = Doxygen::symbolCache->add(that,(void **)&victim); - //printf("adding %s to cache, handle=%d\n",m_impl->name.data(),that->m_cacheHandle); - if (victim) // cache was full, victim was the least recently used item and has to go - { - victim->m_cacheHandle=-1; // invalidate cache handle - victim->saveToDisk(); // store the item on disk - } - else // cache not yet full - { - //printf("Adding %s to cache, handle=%d\n",m_impl->name.data(),m_cacheHandle); - } - if (m_storagePos!=-1) // already been written to disk - { - if (isLocked()) // locked in memory - { - assert(m_impl!=0); - that->m_flushPending=FALSE; // no need to flush anymore - } - else // not locked in memory - { - assert(m_impl==0); - loadFromDisk(); - } - } - } - else // already cached, make this object the most recently used. - { - assert(m_impl!=0); - //printf("Touching symbol %s\n",m_impl->name.data()); - Doxygen::symbolCache->use(m_cacheHandle); - } -} - -void Definition::saveToDisk() const { - assert(m_impl!=0); - Definition *that = (Definition *)this; - if (isLocked()) // cannot flush the item as it is locked - { - that->m_flushPending=TRUE; // flush when unlocked - } - else // ready to flush the item to disk - { - //printf("Adding %s to cache, handle=%d by replacing %s\n", - // m_impl->name.data(),m_cacheHandle,victim->m_impl->name.data()); - if (m_storagePos!=-1) - // if victim was stored on disk already and is not locked - { - // free the storage space occupied by the old store item - Doxygen::symbolStorage->release(m_storagePos); // free up space for others - } - // write a the new (possibly modified) instance to disk - flushToDisk(); - // end to write sequence (unless nothing was written due to the lock) - Doxygen::symbolStorage->end(); - } } + void Definition::flushToDisk() const { //printf("%p: Definition::flushToDisk()\n",this); Definition *that = (Definition *)this; - that->m_storagePos = Doxygen::symbolStorage->alloc(); //printf("Definition::flushToDisk(): pos=%d\n",(int)m_storagePos); marshalUInt(Doxygen::symbolStorage,START_MARKER); marshalSectionDict (Doxygen::symbolStorage,m_impl->sectionDict); @@ -1262,7 +1193,6 @@ void Definition::flushToDisk() const marshalUInt(Doxygen::symbolStorage,END_MARKER); delete that->m_impl; that->m_impl = 0; - that->m_flushPending=FALSE; } void Definition::loadFromDisk() const @@ -1271,7 +1201,6 @@ void Definition::loadFromDisk() const Definition *that = (Definition *)this; assert(m_impl==0); that->m_impl = new DefinitionImpl; - Doxygen::symbolStorage->seek(m_storagePos); uint marker = unmarshalUInt(Doxygen::symbolStorage); assert(marker==START_MARKER); m_impl->sectionDict = unmarshalSectionDict (Doxygen::symbolStorage); @@ -1294,18 +1223,3 @@ void Definition::loadFromDisk() const assert(marker==END_MARKER); } -void Definition::lock() const -{ -} - -void Definition::unlock() const -{ - if (m_flushPending && !isLocked()) - { - // write a the new (possibly modified) instance to disk - flushToDisk(); - // end to write sequence (unless nothing was written due to the lock) - Doxygen::symbolStorage->end(); - } -} - |