* @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 */
| 49 | * function or use -e "print" with the cachesim binary |
| 50 | */ |
| 51 | cache_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 |
no test coverage detected