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

Function RM_CreateStringFromString

src/module.cpp:1234–1238  ·  view source on GitHub ↗

Like RedisModule_CreatString(), but creates a string starting from another * RedisModuleString. * * The returned string must be released with RedisModule_FreeString() or by * enabling automatic memory management. * * The passed context 'ctx' may be NULL if necessary, see the * RedisModule_CreateString() documentation for more info. */

Source from the content-addressed store, hash-verified

1232 * The passed context 'ctx' may be NULL if necessary, see the
1233 * RedisModule_CreateString() documentation for more info. */
1234RedisModuleString *RM_CreateStringFromString(RedisModuleCtx *ctx, const RedisModuleString *str) {
1235 RedisModuleString *o = dupStringObject(str);
1236 if (ctx != NULL) autoMemoryAdd(ctx,REDISMODULE_AM_STRING,o);
1237 return o;
1238}
1239
1240/* Creates a string from a stream ID. The returned string must be released with
1241 * RedisModule_FreeString(), unless automatic memory is enabled.

Callers 1

RM_HoldStringFunction · 0.85

Calls 2

dupStringObjectFunction · 0.85
autoMemoryAddFunction · 0.85

Tested by

no test coverage detected