[Tarantool-patches] [PATCH v3 05/16] lua: don't raise a Lua error from luaT_tuple_new()

Alexander Turenko alexander.turenko at tarantool.org
Thu Oct 15 16:17:25 MSK 2020


On Thu, Oct 15, 2020 at 01:41:47AM +0200, Vladislav Shpilevoy wrote:
> Thanks for the patch!
> 
> > diff --git a/src/box/lua/tuple.c b/src/box/lua/tuple.c
> > index ed97c85e4..8c3d29f71 100644
> > --- a/src/box/lua/tuple.c
> > +++ b/src/box/lua/tuple.c
> > @@ -69,6 +69,8 @@ extern char tuple_lua[]; /* Lua source */
> >  
> >  uint32_t CTID_STRUCT_TUPLE_REF;
> >  
> > +static int luaT_tuple_encode_table_ref = LUA_NOREF;
> 
> This probably needs a comment.

Added on the branches:

+/**
+ * <luaT_tuple_encode_table>() reference in the Lua registry.
+ *
+ * Storing of the reference allows to don't create a new GCfunc
+ * object each time we call the function in the protected mode.
+ * It reduces Lua GC pressure in comparison with calling of
+ * <lua_cpcall>() or <lua_pushcfunction>() on each invocation.
+ */
 static int luaT_tuple_encode_table_ref = LUA_NOREF;


More information about the Tarantool-patches mailing list