* @brief initialize a Size cache * * @param ccache_params some common cache parameters * @param cache_specific_params Size specific parameters, should be NULL */
| 52 | * @param cache_specific_params Size specific parameters, should be NULL |
| 53 | */ |
| 54 | cache_t *Size_init(const common_cache_params_t ccache_params, |
| 55 | |
| 56 | const char *cache_specific_params) { |
| 57 | cache_t *cache = cache_struct_init("Size", ccache_params, cache_specific_params); |
| 58 | cache->cache_init = Size_init; |
| 59 | cache->cache_free = Size_free; |
| 60 | cache->get = Size_get; |
| 61 | cache->find = Size_find; |
| 62 | cache->insert = Size_insert; |
| 63 | cache->evict = Size_evict; |
| 64 | cache->to_evict = Size_to_evict; |
| 65 | cache->remove = Size_remove; |
| 66 | |
| 67 | Size_params_t *params = my_malloc(Size_params_t); |
| 68 | cache->eviction_params = params; |
| 69 | |
| 70 | params->pq = pqueue_init((unsigned long)8e6); |
| 71 | return cache; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * free resources used by this cache |
no test coverage detected