* @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 */
| 183 | * @return the object to be evicted |
| 184 | */ |
| 185 | static 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 |
nothing calls this directly
no test coverage detected