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

Function Clock_remove_obj

libCacheSim/cache/eviction/Clock.c:247–253  ·  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

245 * @param obj
246 */
247static void Clock_remove_obj(cache_t *cache, cache_obj_t *obj) {
248 Clock_params_t *params = (Clock_params_t *)cache->eviction_params;
249
250 DEBUG_ASSERT(obj != NULL);
251 remove_obj_from_list(&params->q_head, &params->q_tail, obj);
252 cache_remove_obj_base(cache, obj, true);
253}
254
255/**
256 * @brief remove an object from the cache

Callers 1

Clock_removeFunction · 0.85

Calls 2

remove_obj_from_listFunction · 0.85
cache_remove_obj_baseFunction · 0.85

Tested by

no test coverage detected