Comparison

util-src/table.c @ 7969:1c6a07606309

util-src: Specify size of various tables to be allocated
author Kim Alvefur <zash@zash.se>
date Thu, 09 Mar 2017 01:20:59 +0100
parent 7936:582bfb39337f
child 12402:8deb401a21f6
comparison
equal deleted inserted replaced
7968:f0e35f4db9e0 7969:1c6a07606309
22 22
23 int luaopen_util_table(lua_State *L) { 23 int luaopen_util_table(lua_State *L) {
24 #if (LUA_VERSION_NUM > 501) 24 #if (LUA_VERSION_NUM > 501)
25 luaL_checkversion(L); 25 luaL_checkversion(L);
26 #endif 26 #endif
27 lua_newtable(L); 27 lua_createtable(L, 0, 2);
28 lua_pushcfunction(L, Lcreate_table); 28 lua_pushcfunction(L, Lcreate_table);
29 lua_setfield(L, -2, "create"); 29 lua_setfield(L, -2, "create");
30 lua_pushcfunction(L, Lpack); 30 lua_pushcfunction(L, Lpack);
31 lua_setfield(L, -2, "pack"); 31 lua_setfield(L, -2, "pack");
32 return 1; 32 return 1;