summaryrefslogtreecommitdiffstats
path: root/src/objcache.h
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2011-12-10 20:30:14 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2011-12-10 20:30:14 (GMT)
commite7c5e0d738bcc16bb2194740fd009242d4059045 (patch)
treebb2f8266e3a639e6a4b15f02416a3aae5173c275 /src/objcache.h
parentcfb38c32173c3a16dc1c8e868b4cc23a68ed28b8 (diff)
downloadDoxygen-e7c5e0d738bcc16bb2194740fd009242d4059045.zip
Doxygen-e7c5e0d738bcc16bb2194740fd009242d4059045.tar.gz
Doxygen-e7c5e0d738bcc16bb2194740fd009242d4059045.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