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

Function LRB_insert

libCacheSim/cache/eviction/LRB/LRB_Interface.cpp:210–218  ·  view source on GitHub ↗

* @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 */

Source from the content-addressed store, hash-verified

208 * @return the inserted object
209 */
210static 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,

Callers

nothing calls this directly

Calls 2

reinitMethod · 0.45
admitMethod · 0.45

Tested by

no test coverage detected