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

Function GDSF_init

libCacheSim/cache/eviction/cpp/GDSF.cpp:51–72  ·  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

49 * function or use -e "print" with the cachesim binary
50 */
51cache_t *GDSF_init(const common_cache_params_t ccache_params, const char *cache_specific_params) {
52 cache_t *cache = cache_struct_init("GDSF", ccache_params, cache_specific_params);
53 cache->eviction_params = reinterpret_cast<void *>(new eviction::GDSF);
54
55 cache->cache_init = GDSF_init;
56 cache->cache_free = GDSF_free;
57 cache->get = GDSF_get;
58 cache->find = GDSF_find;
59 cache->insert = GDSF_insert;
60 cache->evict = GDSF_evict;
61 cache->to_evict = GDSF_to_evict;
62 cache->remove = GDSF_remove;
63
64 if (ccache_params.consider_obj_metadata) {
65 // freq + priority
66 cache->obj_md_size = 8;
67 } else {
68 cache->obj_md_size = 0;
69 }
70
71 return cache;
72}
73
74/**
75 * free resources used by this cache

Callers 2

create_test_cacheFunction · 0.85
create_cacheFunction · 0.85

Calls 1

cache_struct_initFunction · 0.85

Tested by

no test coverage detected