summaryrefslogtreecommitdiffstats
path: root/src/objcache.h
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2011-12-10 20:30:14 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2011-12-10 20:30:14 (GMT)
commitb625258a2f46f61e85bf473dfa64b719755c3b71 (patch)
treebb2f8266e3a639e6a4b15f02416a3aae5173c275 /src/objcache.h
parente48f695c385ccc356e124ac3a851a6228f4f5b84 (diff)
downloadDoxygen-b625258a2f46f61e85bf473dfa64b719755c3b71.zip
Doxygen-b625258a2f46f61e85bf473dfa64b719755c3b71.tar.gz
Doxygen-b625258a2f46f61e85bf473dfa64b719755c3b71.tar.bz2
Release-1.7.6.1
Diffstat (limited to 'src/objcache.h')
-rw-r--r--src/objcache.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/objcache.h b/src/objcache.h
index 5e0a3e0..c89ec2c 100644
--- a/src/objcache.h
+++ b/src/objcache.h
@@ -71,9 +71,9 @@ class ObjCache
*/
void use(int handle)
{
- hits++;
if (handle==m_lastHandle) return;
m_lastHandle = handle;
+ m_hits++;
moveToFront(handle);
}
@@ -87,6 +87,22 @@ class ObjCache
/*! Print miss/hits statistics */
void printStats();
+ /*! total size of the cache */
+ int size() const { return m_size; }
+
+ /*! number of elements in the cache */
+ int count() const { return m_count; }
+
+ int hits() const
+ {
+ return m_hits;
+ }
+ int misses() const
+ {
+ return m_misses;
+ }
+
+
private:
void moveToFront(int index);
unsigned int hash(void *addr);
@@ -99,14 +115,12 @@ class ObjCache
int m_head;
int m_tail;
int m_size;
+ int m_count;
int m_freeHashNodes;
int m_freeCacheNodes;
int m_lastHandle;
-
-#ifdef CACHE_STATS
- static int misses;
- static int hits;
-#endif
+ int m_misses;
+ int m_hits;
};
#endif // OBJCACHE_H