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

Function RandomTwo_init

libCacheSim/cache/eviction/RandomTwo.c:47–64  ·  view source on GitHub ↗

end user facing functions init, free, get * @brief initialize a RandomTwo cache * * @param ccache_params some common cache parameters * @param cache_specific_params RandomTwo specific parameters, should be NULL */

Source from the content-addressed store, hash-verified

45 * @param cache_specific_params RandomTwo specific parameters, should be NULL
46 */
47cache_t *RandomTwo_init(const common_cache_params_t ccache_params,
48 const char *cache_specific_params) {
49 common_cache_params_t ccache_params_copy = ccache_params;
50 ccache_params_copy.hashpower = MAX(12, ccache_params_copy.hashpower - 8);
51
52 cache_t *cache =
53 cache_struct_init("RandomTwo", ccache_params_copy, cache_specific_params);
54 cache->cache_init = RandomTwo_init;
55 cache->cache_free = RandomTwo_free;
56 cache->get = RandomTwo_get;
57 cache->find = RandomTwo_find;
58 cache->insert = RandomTwo_insert;
59 cache->to_evict = RandomTwo_to_evict;
60 cache->evict = RandomTwo_evict;
61 cache->remove = RandomTwo_remove;
62
63 return cache;
64}
65
66/**
67 * free resources used by this cache

Callers 1

create_cacheFunction · 0.85

Calls 1

cache_struct_initFunction · 0.85

Tested by

no test coverage detected