MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / moduleFreeContext

Function moduleFreeContext

src/module.cpp:693–709  ·  view source on GitHub ↗

Free the context after the user function was called. */

Source from the content-addressed store, hash-verified

691
692/* Free the context after the user function was called. */
693void moduleFreeContext(RedisModuleCtx *ctx, bool propogate) {
694 if (propogate)
695 moduleHandlePropagationAfterCommandCallback(ctx);
696 autoMemoryCollect(ctx);
697 poolAllocRelease(ctx);
698 if (ctx->postponed_arrays) {
699 zfree(ctx->postponed_arrays);
700 ctx->postponed_arrays_count = 0;
701 serverLog(LL_WARNING,
702 "API misuse detected in module %s: "
703 "RedisModule_ReplyWithArray(REDISMODULE_POSTPONED_ARRAY_LEN) "
704 "not matched by the same number of RedisModule_SetReplyArrayLen() "
705 "calls.",
706 ctx->module->name);
707 }
708 if (ctx->flags & REDISMODULE_CTX_THREAD_SAFE) freeClient(ctx->client);
709}
710
711/* This Redis command binds the normal Redis command invocation with commands
712 * exported by modules. */

Callers 15

rdbSaveObjectFunction · 0.85
rdbSaveSingleModuleAuxFunction · 0.85
rdbLoadObjectFunction · 0.85
rdbLoadRioFunction · 0.85
RM_SaveDataTypeToStringFunction · 0.85
unblockClientFromModuleFunction · 0.85

Calls 6

autoMemoryCollectFunction · 0.85
poolAllocReleaseFunction · 0.85
zfreeFunction · 0.85
serverLogFunction · 0.85
freeClientFunction · 0.70

Tested by

no test coverage detected