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
| 1128 | * memory management will not be available, and the string memory must be |
| 1129 | * managed manually. */ |
| 1130 | RedisModuleString *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 |
no test coverage detected