MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_FreeServerInfo

Function RM_FreeServerInfo

app/redis-6.2.6/src/module.c:7121–7134  ·  view source on GitHub ↗

Free data created with RM_GetServerInfo(). You need to pass the * context pointer 'ctx' only if the dictionary was created using the * context instead of passing NULL. */

Source from the content-addressed store, hash-verified

7119 * context pointer 'ctx' only if the dictionary was created using the
7120 * context instead of passing NULL. */
7121void RM_FreeServerInfo(RedisModuleCtx *ctx, RedisModuleServerInfoData *data) {
7122 if (ctx != NULL) autoMemoryFreed(ctx,REDISMODULE_AM_INFO,data);
7123 raxIterator ri;
7124 raxStart(&ri,data->rax);
7125 while(1) {
7126 raxSeek(&ri,"^",NULL,0);
7127 if (!raxNext(&ri)) break;
7128 raxRemove(data->rax,(unsigned char*)ri.key,ri.key_len,NULL);
7129 sdsfree(ri.data);
7130 }
7131 raxStop(&ri);
7132 raxFree(data->rax);
7133 zfree(data);
7134}
7135
7136/* Get the value of a field from data collected with RM_GetServerInfo(). You
7137 * need to pass the context pointer 'ctx' only if you want to use auto memory

Callers 1

autoMemoryCollectFunction · 0.85

Calls 9

autoMemoryFreedFunction · 0.85
raxStartFunction · 0.85
raxSeekFunction · 0.85
raxNextFunction · 0.85
raxRemoveFunction · 0.85
sdsfreeFunction · 0.85
raxStopFunction · 0.85
raxFreeFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected