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

Function CacheArray_FindMinLRU

src/util/cache/cache_array.c:11–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "../../RG.h"
10
11CacheEntry *CacheArray_FindMinLRU(CacheEntry *cache_arr, uint cap) {
12 ASSERT(cache_arr != NULL);
13
14 CacheEntry *min_LRU_entry = cache_arr;
15
16 for(size_t i = 1; i < cap; i++) {
17 CacheEntry *current_entry = cache_arr + i;
18 if(current_entry->LRU < min_LRU_entry->LRU) {
19 min_LRU_entry = current_entry;
20 }
21 }
22
23 return min_LRU_entry;
24}
25
26CacheEntry *CacheArray_PopulateEntry(long long counter, CacheEntry *entry, char *key,
27 void *value) {

Callers 1

_CacheEvictLRUFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected