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

Function ClockPro_remove

libCacheSim/cache/eviction/ClockPro.c:300–309  ·  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

298 * cache
299 */
300static bool ClockPro_remove(cache_t *cache, const obj_id_t obj_id) {
301 cache_obj_t *obj = hashtable_find_obj_id(cache->hashtable, obj_id);
302 if (obj == NULL) {
303 return false;
304 }
305
306 ClockPro_remove_obj(cache, obj);
307
308 return true;
309}
310
311static bool ClockPro_can_insert(cache_t *cache, const request_t *req) {
312 ClockPro_params_t *params = (ClockPro_params_t *)cache->eviction_params;

Callers

nothing calls this directly

Calls 1

ClockPro_remove_objFunction · 0.85

Tested by

no test coverage detected