| 11 | #include <pthread.h> |
| 12 | |
| 13 | static CacheEntry *_CacheEvictLRU(Cache *cache) { |
| 14 | CacheEntry *entry = CacheArray_FindMinLRU(cache->arr, cache->cap); |
| 15 | // Remove evicted element from the rax. |
| 16 | raxRemove(cache->lookup, (unsigned char *)entry->key, |
| 17 | strlen(entry->key), NULL); |
| 18 | CacheArray_CleanEntry(entry, cache->free_item); |
| 19 | |
| 20 | return entry; |
| 21 | } |
| 22 | |
| 23 | static bool _Cache_SetValue(Cache *cache, const char *key, void *value, |
| 24 | size_t key_len) { |
no test coverage detected