[Tarantool-patches] [PATCH] lua: lua_field_inspect_table without pushcfunction

Kirill Yukhin kyukhin at tarantool.org
Wed Jun 10 15:15:06 MSK 2020


Hello,

On 18 май 12:37, Sergey Kaplun wrote:
> Currently on encoding table we push cfunction (lua_field_try_serialize)
> to lua stack with additional lightuserdata and table value and after
> pcall that function to avoid a raise of error.
> 
> In this case LuaJIT creates new object which will not live long time,
> so it increase amount of dead object and also increase time and
> frequency of garbage collection inside LuaJIT.
> Also this pcall is necessary only in case when metafield __serialize
> of serilizable object has LUA_TFUNCTION type.
> 
> So instead pushcfunction with pcall we can directly call the function
> trying to serialize an object.
> ---
> 
> branch: https://github.com/tarantool/tarantool/tree/skaplun/no-ticket-lua-inspect-table-refactoring

I've checked your patch into master.

--
Regards, Kirill Yukhin


More information about the Tarantool-patches mailing list