diff --git a/src/box/lua/console.c b/src/box/lua/console.c index e447fb627f0fc75c156441138e0d70f932d86bdc..443bd9025a086285fc3c0c0f912fc2ce0629b338 100644 --- a/src/box/lua/console.c +++ b/src/box/lua/console.c @@ -948,9 +948,6 @@ tarantool_lua_console_init(struct lua_State *L) */ lua_setfield(L, -2, "formatter_lua"); - /* Output formatter in Lua mode */ - lua_serializer_init(L); - struct session_vtab console_session_vtab = { .push = console_session_push, .fd = console_session_fd, diff --git a/src/box/lua/serialize_lua.c b/src/box/lua/serialize_lua.c index 3869f6e1da76fdd06dd2e32f86632a8448fc5b42..e4f20c792b93f5c72433c2755660ddf4b54af04d 100644 --- a/src/box/lua/serialize_lua.c +++ b/src/box/lua/serialize_lua.c @@ -54,9 +54,6 @@ static_assert(DT_IVAL_TO_STRING_BUFSIZE > FPCONV_G_FMT_BUFSIZE, static_assert(DT_IVAL_TO_STRING_BUFSIZE > DT_TO_STRING_BUFSIZE, "Buffer is too small"); -/* Serializer for Lua output mode */ -static struct luaL_serializer *serializer_lua; - enum { NODE_NONE_BIT = 0, NODE_ROOT_BIT = 1, @@ -1042,34 +1039,3 @@ lua_parse_opts(lua_State *L, lua_dumper_opts_t *opts) opts->indent_lvl = (int)lua_tonumber(L, -1); lua_pop(L, 1); } - -/** - * Initialize Lua serializer. - */ -void -lua_serializer_init(struct lua_State *L) -{ - /* - * We don't export it as a module - * for a while, so the library - * is kept empty. - */ - static const luaL_Reg lualib[] = { - { - .name = NULL, - }, - }; - - serializer_lua = luaL_newserializer(L, NULL, lualib); - serializer_lua->has_compact = 1; - serializer_lua->encode_invalid_numbers = 1; - serializer_lua->encode_load_metatables = 1; - serializer_lua->encode_use_tostring = 1; - serializer_lua->encode_invalid_as_nil = 1; - - /* - * Keep a reference to this module so it - * won't be unloaded. - */ - lua_setfield(L, -2, "formatter_lua"); -} diff --git a/src/box/lua/serialize_lua.h b/src/box/lua/serialize_lua.h index 923e13be9267c6f5f3180e52edff1ef9d0ceb8b2..24bc79a01f161821966c8330e6d9cf3df9ba8534 100644 --- a/src/box/lua/serialize_lua.h +++ b/src/box/lua/serialize_lua.h @@ -50,9 +50,6 @@ typedef struct { bool block_mode; } lua_dumper_opts_t; -void -lua_serializer_init(struct lua_State *L); - int lua_encode(lua_State *L, struct luaL_serializer *serializer, lua_dumper_opts_t *opts);