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

Function SlowLog_Free

src/slow_log/slow_log.c:314–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314void SlowLog_Free(SlowLog *slowlog) {
315 for(int i = 0; i < slowlog->count; i++) {
316 rax *lookup = slowlog->lookup[i];
317 heap_t *heap = slowlog->min_heap[i];
318
319 raxIterator iter;
320 raxStart(&iter, lookup);
321 raxSeek(&iter, "^", NULL, 0);
322 while(raxNext(&iter)) {
323 SlowLogItem *item = iter.data;
324 _SlowLog_Item_Free(item);
325 }
326 raxStop(&iter);
327
328 raxFree(lookup);
329 Heap_free(heap);
330 int res = pthread_mutex_destroy(slowlog->locks + i);
331 ASSERT(res == 0);
332 }
333
334 rm_free(slowlog->locks);
335 rm_free(slowlog->lookup);
336 rm_free(slowlog->min_heap);
337 rm_free(slowlog);
338}
339

Callers 2

SlowLog_ReplayFunction · 0.85
_GraphContext_FreeFunction · 0.85

Calls 3

_SlowLog_Item_FreeFunction · 0.85
Heap_freeFunction · 0.85
rm_freeFunction · 0.85

Tested by

no test coverage detected