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

Function Size_to_evict

libCacheSim/cache/eviction/Size.c:185–189  ·  view source on GitHub ↗

* @brief find the object to be evicted * this function does not actually evict the object or update metadata * not all eviction algorithms support this function * because the eviction logic cannot be decoupled from finding eviction * candidate, so use assert(false) if you cannot support this function * * @param cache the cache * @return the object to be evicted */

Source from the content-addressed store, hash-verified

183 * @return the object to be evicted
184 */
185static cache_obj_t *Size_to_evict(cache_t *cache, const request_t *req) {
186 Size_params_t *params = cache->eviction_params;
187 pq_node_t *node = (pq_node_t *)pqueue_peek(params->pq);
188 return hashtable_find_obj_id(cache->hashtable, node->obj_id);
189}
190
191/**
192 * @brief evict an object from the cache

Callers

nothing calls this directly

Calls 1

pqueue_peekFunction · 0.85

Tested by

no test coverage detected