VISH
0.2
|
A root object that holds a tail of cacheable objects. More...
#include </home/werner/origo/vish/memcore/CacheQueue.hpp>
A root object that holds a tail of cacheable objects.
bool MemCore::CacheQueue::adjust | ( | const CacheBase & | theCache, |
memsize_t | newCost, | ||
CacheQueue & | TemporarilyUnreleasable, | ||
CacheQueue & | PermanentlyUnreleasable | ||
) |
Try to adjust the cache by releasing objects from the queue until the new cost is achieved.
theCache | The Cache management object |
newCost | The memory occupation of the object that is supposed to be inserted soon. |
TemporarilyUnreleasable | A CacheQueue where objects will be put that appear to be temporarily unreleasable. |
PermanentlyUnreleasable | A CacheQueue for objects that seem to be unreleasable at all. |
memsize_t MemCore::CacheQueue::compute_memsize | ( | ) | const |
Internal Debugging Function which computes the memsize by inspecting and summing up each object's contribution.
The CacheQueue object will return the size occupied by all cached objects.
This function will be slow as compared to memsize(), and is only intended to be used occasionally for verifying that memsize() does return the correct value. How it actually should work is cacheable objects adding and subtracting themselves from the cachequeue overall memory size.
int MemCore::CacheQueue::nEntries | ( | ) | const |
Count the number of entries here.
Never call this function, it is maximally slow.