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

Function Belady_remove_obj

libCacheSim/cache/eviction/Belady.c:245–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245static void Belady_remove_obj(cache_t *cache, cache_obj_t *obj) {
246 Belady_params_t *params = cache->eviction_params;
247 DEBUG_ASSERT(obj != NULL);
248
249 if (obj->Belady.pq_node != NULL) {
250 /* if it is NULL, it means we have deleted the entry in pq before this */
251 pqueue_remove(params->pq, obj->Belady.pq_node);
252 my_free(sizeof(pq_node_t), obj->Belady.pq_node);
253 obj->Belady.pq_node = NULL;
254 }
255
256 cache_remove_obj_base(cache, obj, true);
257}
258
259/**
260 * @brief remove an object from the cache

Callers 1

Belady_removeFunction · 0.85

Calls 2

pqueue_removeFunction · 0.85
cache_remove_obj_baseFunction · 0.85

Tested by

no test coverage detected