[Tarantool-patches] [PATCH v2 07/15] module api/lua: expose luaT_tuple_new()

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Oct 11 18:25:27 MSK 2020


Thanks for the patch!

See 1 comment below.

> diff --git a/src/box/lua/tuple.h b/src/box/lua/tuple.h
> index aadcf7f59..0c7e8a16f 100644
> --- a/src/box/lua/tuple.h
> +++ b/src/box/lua/tuple.h
> @@ -92,21 +92,35 @@ luaT_istuple(struct lua_State *L, int idx);
>   * should call <box_region_truncate>() to release the data.
>   *
>   * In case of an error set a diag and return NULL.
> + *
> + * @sa luaT_tuple_new()
>   */
>  API_EXPORT char *
>  luaT_tuple_encode(struct lua_State *L, int idx, size_t *tuple_len_ptr);
>  
> -/** \endcond public */
> -
>  /**
>   * Create a new tuple with specific format from a Lua table or a
>   * tuple.
>   *
> + * The new tuple is referenced in the same way as one created by
> + * <box_tuple_new>(). There are two possible usage scenarious:
> + *
> + * 1. A short living tuple may not be referenced explicitly and
> + *    will be collected automatically at the next module API call
> + *    that yields or returns a tuple.
> + * 2. A long living tuple must be referenced using
> + *    <box_tuple_ref>() and unreferenced than with

than -> then.


More information about the Tarantool-patches mailing list