* @brief evict an object from the cache * it needs to call cache_evict_base before returning * which updates some metadata such as n_obj, occupied size, and hash table * * @param cache * @param req not used */
| 197 | * @param req not used |
| 198 | */ |
| 199 | static void Size_evict(cache_t *cache, |
| 200 | const request_t *req) { |
| 201 | Size_params_t *params = cache->eviction_params; |
| 202 | pq_node_t *node = (pq_node_t *)pqueue_pop(params->pq); |
| 203 | |
| 204 | cache_obj_t *obj_to_evict = |
| 205 | hashtable_find_obj_id(cache->hashtable, node->obj_id); |
| 206 | DEBUG_ASSERT(node == obj_to_evict->Size.pq_node); |
| 207 | |
| 208 | obj_to_evict->Size.pq_node = NULL; |
| 209 | my_free(sizeof(pq_node_t), node); |
| 210 | |
| 211 | cache_evict_base(cache, obj_to_evict, true); |
| 212 | } |
| 213 | |
| 214 | static void Size_remove_obj(cache_t *cache, cache_obj_t *obj) { |
| 215 | Size_params_t *params = cache->eviction_params; |
nothing calls this directly
no test coverage detected