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

Function RM_CreateString

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

Create a new module string object. The returned string must be freed * with RedisModule_FreeString(), unless automatic memory is enabled. * * The string is created by copying the `len` bytes starting * at `ptr`. No reference is retained to the passed buffer. * * The module context 'ctx' is optional and may be NULL if you want to create * a string out of the context scope. However in that ca

Source from the content-addressed store, hash-verified

1128 * memory management will not be available, and the string memory must be
1129 * managed manually. */
1130RedisModuleString *RM_CreateString(RedisModuleCtx *ctx, const char *ptr, size_t len) {
1131 RedisModuleString *o = createStringObject(ptr,len);
1132 if (ctx != NULL) autoMemoryAdd(ctx,REDISMODULE_AM_STRING,o);
1133 return o;
1134}
1135
1136/* Create a new module string object from a printf format and arguments.
1137 * The returned string must be freed with RedisModule_FreeString(), unless

Callers 6

RM_DictNextFunction · 0.85
RM_DictPrevFunction · 0.85

Calls 2

autoMemoryAddFunction · 0.85
createStringObjectFunction · 0.70

Tested by

no test coverage detected