From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 24AD4469719 for ; Thu, 15 Oct 2020 16:17:05 +0300 (MSK) Date: Thu, 15 Oct 2020 16:17:25 +0300 From: Alexander Turenko Message-ID: <20201015131725.zrkh6fkhoq3mmxpw@tkn_work_nb> References: <42ad1a3a103505e13c78f5e82c84db88c703afd9.1602541394.git.alexander.turenko@tarantool.org> <4c0f21e6-9b35-d8ce-bcc1-6e814aea34e9@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4c0f21e6-9b35-d8ce-bcc1-6e814aea34e9@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v3 05/16] lua: don't raise a Lua error from luaT_tuple_new() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org 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: +/** + * () 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 + * () or () on each invocation. + */ static int luaT_tuple_encode_table_ref = LUA_NOREF;