* @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
| 270 | * cache |
| 271 | */ |
| 272 | static bool Belady_remove(cache_t *cache, const obj_id_t obj_id) { |
| 273 | cache_obj_t *obj = hashtable_find_obj_id(cache->hashtable, obj_id); |
| 274 | if (obj == NULL) { |
| 275 | return false; |
| 276 | } |
| 277 | |
| 278 | Belady_remove_obj(cache, obj); |
| 279 | return true; |
| 280 | } |
| 281 | |
| 282 | #ifdef __cplusplus |
| 283 | } |
nothing calls this directly
no test coverage detected