MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / cache_remove_obj_base

Function cache_remove_obj_base

libCacheSim/cache/cache.c:322–329  ·  view source on GitHub ↗

* @brief this function is called by all eviction algorithms that * need to remove an object from the cache, it updates the cache metadata, * because it frees the object struct, it needs to be called at the end of * the eviction function. * * @param cache the cache * @param obj the object to be removed */

Source from the content-addressed store, hash-verified

320 * @param obj the object to be removed
321 */
322void cache_remove_obj_base(cache_t *cache, cache_obj_t *obj, bool remove_from_hashtable) {
323 DEBUG_ASSERT(cache->occupied_byte >= obj->obj_size + cache->obj_md_size);
324 cache->occupied_byte -= (obj->obj_size + cache->obj_md_size);
325 cache->n_obj -= 1;
326 if (remove_from_hashtable) {
327 hashtable_delete(cache->hashtable, obj);
328 }
329}
330
331/**
332 * @brief print the recorded eviction age

Callers 15

cache_evict_baseFunction · 0.85
LRU_Prob_evictFunction · 0.85
LRU_Prob_remove_objFunction · 0.85
nop_remove_objFunction · 0.85
nop_removeFunction · 0.85
Clock_remove_objFunction · 0.85
FIFO_removeFunction · 0.85
RandomLRU_removeFunction · 0.85
LFUDA_remove_objFunction · 0.85
LFU_remove_objFunction · 0.85
LRU_remove_objFunction · 0.85
LRU_removeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected