end user facing functions init, free, get * @brief initialize a nop cache * * @param ccache_params some common cache parameters * @param cache_specific_params nop specific parameters, should be NULL */
| 45 | * @param cache_specific_params nop specific parameters, should be NULL |
| 46 | */ |
| 47 | cache_t *nop_init(const common_cache_params_t ccache_params, |
| 48 | const char *cache_specific_params) { |
| 49 | cache_t *cache = |
| 50 | cache_struct_init("nop", ccache_params, cache_specific_params); |
| 51 | cache->cache_init = nop_init; |
| 52 | cache->cache_free = nop_free; |
| 53 | cache->get = nop_get; |
| 54 | cache->find = nop_find; |
| 55 | cache->insert = nop_insert; |
| 56 | cache->evict = nop_evict; |
| 57 | cache->remove = nop_remove; |
| 58 | cache->to_evict = nop_to_evict; |
| 59 | cache->get_occupied_byte = cache_get_occupied_byte_default; |
| 60 | cache->can_insert = cache_can_insert_default; |
| 61 | cache->get_n_obj = cache_get_n_obj_default; |
| 62 | |
| 63 | cache->obj_md_size = 0; |
| 64 | |
| 65 | return cache; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * free resources used by this cache |
no test coverage detected