summaryrefslogtreecommitdiffstats
path: root/src/definition.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2006-10-04 20:28:41 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2006-10-04 20:28:41 (GMT)
commit3c8148441a129febc5c2b9e4b2b2cbd018ad3b6e (patch)
treed2526ce0c99b1f268769fd8bd1c56e6dda83fd7f /src/definition.cpp
parentc844985adde0459f1f01ed00d0a289591fbcd2af (diff)
downloadDoxygen-3c8148441a129febc5c2b9e4b2b2cbd018ad3b6e.zip
Doxygen-3c8148441a129febc5c2b9e4b2b2cbd018ad3b6e.tar.gz
Doxygen-3c8148441a129febc5c2b9e4b2b2cbd018ad3b6e.tar.bz2
Release-1.4.7-20061004
Diffstat (limited to 'src/definition.cpp')
-rw-r--r--src/definition.cpp88
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();
- }
-}
-