* @brief insert an object into the cache, * update the hash table and cache metadata * this function assumes the cache has enough space * eviction should be * performed before calling this function * * @param cache * @param req * @return the inserted object */
| 208 | * @return the inserted object |
| 209 | */ |
| 210 | static cache_obj_t *LRB_insert(cache_t *cache, const request_t *req) { |
| 211 | auto *params = static_cast<LRB_params_t *>(cache->eviction_params); |
| 212 | auto *lrb = static_cast<lrb::LRBCache *>(params->LRB_cache); |
| 213 | params->lrb_req.reinit(cache->n_req, req->obj_id, req->obj_size, nullptr); |
| 214 | |
| 215 | lrb->admit(params->lrb_req); |
| 216 | |
| 217 | return reinterpret_cast<cache_obj_t *>(0x1); |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * @brief find an eviction candidate, but do not evict from the cache, |