From 46f55dbceab5a860aff60fe8d7ed4b14454ad00b Mon Sep 17 00:00:00 2001 From: Itamar Haber Date: Sun, 6 Sep 2020 18:24:11 +0300 Subject: [PATCH] Updates a couple of comments Specifically: * RM_AutoMemory completed instead of pointing to docs * Updated link to custom type doc --- src/module.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/module.c b/src/module.c index de66af506..2b7d525c6 100644 --- a/src/module.c +++ b/src/module.c @@ -906,10 +906,21 @@ int RM_SignalModifiedKey(RedisModuleCtx *ctx, RedisModuleString *keyname) { * Automatic memory management for modules * -------------------------------------------------------------------------- */ -/* Enable automatic memory management. See API.md for more information. +/* Enable automatic memory management. * * The function must be called as the first function of a command implementation - * that wants to use automatic memory. */ + * that wants to use automatic memory. + * + * When enabled, automatic memory management tracks and automatically frees + * keys, call replies and Redis string objects once the command returns. In most + * cases this eliminates the need of calling the following functions: + * + * 1) RedisModule_CloseKey() + * 2) RedisModule_FreeCallReply() + * 3) RedisModule_FreeString() + * + * These functions can still be used with automatic memory management enabled, + * to optimize loops that make numerous allocations for example. */ void RM_AutoMemory(RedisModuleCtx *ctx) { ctx->flags |= REDISMODULE_CTX_AUTO_MEMORY; } @@ -3574,7 +3585,7 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) { /* Register a new data type exported by the module. The parameters are the * following. Please for in depth documentation check the modules API - * documentation, especially the TYPES.md file. + * documentation, especially https://redis.io/topics/modules-native-types. * * * **name**: A 9 characters data type name that MUST be unique in the Redis * Modules ecosystem. Be creative... and there will be no collisions. Use