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

Function RM_FreeString

src/module.cpp:1264–1267  ·  view source on GitHub ↗

Free a module string object obtained with one of the Redis modules API calls * that return new string objects. * * It is possible to call this function even when automatic memory management * is enabled. In that case the string will be released ASAP and removed * from the pool of string to release at the end. * * If the string was created with a NULL context 'ctx', it is also possible to *

Source from the content-addressed store, hash-verified

1262 * the context, so if you want to free a string out of context later, make sure
1263 * to create it using a NULL context. */
1264void RM_FreeString(RedisModuleCtx *ctx, RedisModuleString *str) {
1265 decrRefCount(str);
1266 if (ctx != NULL) autoMemoryFreed(ctx,REDISMODULE_AM_STRING,str);
1267}
1268
1269/* Every call to this function, will make the string 'str' requiring
1270 * an additional call to RedisModule_FreeString() in order to really

Callers

nothing calls this directly

Calls 2

decrRefCountFunction · 0.85
autoMemoryFreedFunction · 0.85

Tested by

no test coverage detected