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

Function RM_FreeDict

src/module.cpp:6864–6868  ·  view source on GitHub ↗

Free a dictionary created with RM_CreateDict(). 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

6862 * context pointer 'ctx' only if the dictionary was created using the
6863 * context instead of passing NULL. */
6864void RM_FreeDict(RedisModuleCtx *ctx, RedisModuleDict *d) {
6865 if (ctx != NULL) autoMemoryFreed(ctx,REDISMODULE_AM_DICT,d);
6866 raxFree(d->rax);
6867 zfree(d);
6868}
6869
6870/* Return the size of the dictionary (number of keys). */
6871uint64_t RM_DictSize(RedisModuleDict *d) {

Callers 1

autoMemoryCollectFunction · 0.85

Calls 3

autoMemoryFreedFunction · 0.85
raxFreeFunction · 0.85
zfreeFunction · 0.85

Tested by

no test coverage detected