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

Function QueryCtx_Free

src/query_ctx.c:453–469  ·  view source on GitHub ↗

free the allocations within the QueryCtx and reset it for the next query

Source from the content-addressed store, hash-verified

451
452// free the allocations within the QueryCtx and reset it for the next query
453void QueryCtx_Free(void) {
454 QueryCtx *ctx = _QueryCtx_GetCtx();
455 ASSERT(ctx != NULL);
456
457 UndoLog_Free(&ctx->undo_log);
458 EffectsBuffer_Free(ctx->effects_buffer);
459
460 if(ctx->query_data.params != NULL) {
461 raxFreeWithCallback(ctx->query_data.params, _ParameterFreeCallback);
462 ctx->query_data.params = NULL;
463 }
464
465 rm_free(ctx);
466
467 // NULL-set the context for reuse the next time this thread receives a query
468 QueryCtx_RemoveFromTLS();
469}
470

Callers 8

_ExecuteQueryFunction · 0.85
_queryFunction · 0.85
Graph_ExplainFunction · 0.85
_Constraint_CreateFunction · 0.85
tearDownFunction · 0.85
tearDownFunction · 0.85
tearDownFunction · 0.85
tearDownFunction · 0.85

Calls 5

_QueryCtx_GetCtxFunction · 0.85
UndoLog_FreeFunction · 0.85
EffectsBuffer_FreeFunction · 0.85
rm_freeFunction · 0.85
QueryCtx_RemoveFromTLSFunction · 0.85

Tested by 4

tearDownFunction · 0.68
tearDownFunction · 0.68
tearDownFunction · 0.68
tearDownFunction · 0.68