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

Function Clock_remove

libCacheSim/cache/eviction/Clock.c:268–277  ·  view source on GitHub ↗

* @brief remove an object from the cache * this is different from cache_evict 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 before returning * which updates some metadata such as n_obj, occupied size, and hash table * * @param cache * @param obj_id * @return true if the object is

Source from the content-addressed store, hash-verified

266 * cache
267 */
268static bool Clock_remove(cache_t *cache, const obj_id_t obj_id) {
269 cache_obj_t *obj = hashtable_find_obj_id(cache->hashtable, obj_id);
270 if (obj == NULL) {
271 return false;
272 }
273
274 Clock_remove_obj(cache, obj);
275
276 return true;
277}
278
279// ***********************************************************************
280// **** ****

Callers

nothing calls this directly

Calls 1

Clock_remove_objFunction · 0.85

Tested by

no test coverage detected