[Tarantool-patches] [PATCH v12 5/8] module_cache: rename calls to ref in module structure
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Sun Jan 24 19:27:35 MSK 2021
Thanks for the patch!
Why isn't it in the third commit ("improve naming")?
On 18.01.2021 21:35, Cyrill Gorcunov wrote:
> We will use this field not only to count a number of
> active calls to the module but to prevent the module
> from disappear when it get loaded via "cmod" interface
> (will be implemented in next patches).
>
> Same time make it 64 bit long since there might be a
> number of such references size_t didn't prevent from
> numeric overflow.
>
> Part-of #4642
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
> ---
> src/box/module_cache.c | 8 ++++----
> src/box/module_cache.h | 4 ++--
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/box/module_cache.c b/src/box/module_cache.c
> index 48e55f421..ae874caab 100644
> --- a/src/box/module_cache.c
> +++ b/src/box/module_cache.c
> @@ -214,7 +214,7 @@ module_load(const char *package, const char *package_end)
> memcpy(module->package, package, package_len);
> module->package[package_len] = 0;
> rlist_create(&module->funcs_list);
> - module->calls = 0;
> + module->ref = 0;
I propose to be consistent with the other code and
call it 'refs' instead of 'ref' (see struct error, struct tuple,
struct tuple_format).
> const char *tmpdir = getenv("TMPDIR");
> if (tmpdir == NULL)
More information about the Tarantool-patches
mailing list