MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _CacheEvictLRU

Function _CacheEvictLRU

src/util/cache/cache.c:13–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <pthread.h>
12
13static 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
23static bool _Cache_SetValue(Cache *cache, const char *key, void *value,
24 size_t key_len) {

Callers 1

_Cache_SetValueFunction · 0.85

Calls 2

CacheArray_FindMinLRUFunction · 0.85
CacheArray_CleanEntryFunction · 0.85

Tested by

no test coverage detected