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

Function LRU_remove_obj

libCacheSim/cache/eviction/LRU.c:237–244  ·  view source on GitHub ↗

* @brief remove the given object from the cache * note that eviction should not call this function, but rather call * `cache_evict_base` because we track extra metadata during eviction * * and this function is different from eviction * because it is used to for user trigger * remove, and eviction is used by the cache to make space for new objects * * it needs to call cache_remove_obj_base

Source from the content-addressed store, hash-verified

235 * @param obj
236 */
237static void LRU_remove_obj(cache_t *cache, cache_obj_t *obj) {
238 assert(obj != NULL);
239
240 LRU_params_t *params = (LRU_params_t *)cache->eviction_params;
241
242 remove_obj_from_list(&params->q_head, &params->q_tail, obj);
243 cache_remove_obj_base(cache, obj, true);
244}
245
246/**
247 * @brief remove an object from the cache

Callers

nothing calls this directly

Calls 3

assertFunction · 0.85
remove_obj_from_listFunction · 0.85
cache_remove_obj_baseFunction · 0.85

Tested by

no test coverage detected