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

Function MRU_init

libCacheSim/cache/eviction/MRU.c:52–70  ·  view source on GitHub ↗

* @brief initialize the cache * * @param ccache_params some common cache parameters * @param cache_specific_params cache specific parameters, see parse_params * function or use -e "print" with the cachesim binary */

Source from the content-addressed store, hash-verified

50 * function or use -e "print" with the cachesim binary
51 */
52cache_t *MRU_init(const common_cache_params_t ccache_params,
53 const char *cache_specific_params) {
54 cache_t *cache = cache_struct_init("MRU", ccache_params, cache_specific_params);
55 cache->cache_init = MRU_init;
56 cache->cache_free = MRU_free;
57 cache->get = MRU_get;
58 cache->find = MRU_find;
59 cache->insert = MRU_insert;
60 cache->evict = MRU_evict;
61 cache->to_evict = MRU_to_evict;
62 cache->remove = MRU_remove;
63
64 cache->eviction_params = malloc(sizeof(MRU_params_t));
65 MRU_params_t *params = (MRU_params_t *)cache->eviction_params;
66 params->q_head = NULL;
67 params->q_tail = NULL;
68
69 return cache;
70}
71
72/**
73 * free resources used by this cache

Callers 1

create_test_cacheFunction · 0.85

Calls 1

cache_struct_initFunction · 0.85

Tested by

no test coverage detected