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
| 1155 | * memory management will not be available, and the string memory must be |
| 1156 | * managed manually. */ |
| 1157 | RedisModuleString *RM_CreateString(RedisModuleCtx *ctx, const char *ptr, size_t len) { |
| 1158 | RedisModuleString *o = createStringObject(ptr,len); |
| 1159 | if (ctx != NULL) autoMemoryAdd(ctx,REDISMODULE_AM_STRING,o); |
| 1160 | return o; |
| 1161 | } |
| 1162 | |
| 1163 | /* Create a new module string object from a printf format and arguments. |
| 1164 | * The returned string must be freed with RedisModule_FreeString(), unless |
no test coverage detected