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

Function Size_remove

libCacheSim/cache/eviction/Size.c:241–249  ·  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

239 * cache
240 */
241static bool Size_remove(cache_t *cache, const obj_id_t obj_id) {
242 cache_obj_t *obj = hashtable_find_obj_id(cache->hashtable, obj_id);
243 if (obj == NULL) {
244 return false;
245 }
246
247 Size_remove_obj(cache, obj);
248 return true;
249}
250
251#ifdef __cplusplus
252}

Callers

nothing calls this directly

Calls 1

Size_remove_objFunction · 0.85

Tested by

no test coverage detected