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

Function RM_CreateStringFromString

app/redis-6.2.6/src/module.c:1207–1211  ·  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

1205 * The passed context 'ctx' may be NULL if necessary, see the
1206 * RedisModule_CreateString() documentation for more info. */
1207RedisModuleString *RM_CreateStringFromString(RedisModuleCtx *ctx, const RedisModuleString *str) {
1208 RedisModuleString *o = dupStringObject(str);
1209 if (ctx != NULL) autoMemoryAdd(ctx,REDISMODULE_AM_STRING,o);
1210 return o;
1211}
1212
1213/* Creates a string from a stream ID. The returned string must be released with
1214 * 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