| 10497 | |
| 10498 | |
| 10499 | static void getsizes (lua_State *L) { |
| 10500 | lua_getfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); |
| 10501 | if (lua_isnil(L, -1)) { /* no `size' table? */ |
| 10502 | lua_pop(L, 1); /* remove nil */ |
| 10503 | lua_newtable(L); /* create it */ |
| 10504 | lua_pushvalue(L, -1); /* `size' will be its own metatable */ |
| 10505 | lua_setmetatable(L, -2); |
| 10506 | lua_pushliteral(L, "kv"); |
| 10507 | lua_setfield(L, -2, "__mode"); /* metatable(N).__mode = "kv" */ |
| 10508 | lua_pushvalue(L, -1); |
| 10509 | lua_setfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); /* store in register */ |
| 10510 | } |
| 10511 | } |
| 10512 | |
| 10513 | |
| 10514 | LUALIB_API void luaL_setn (lua_State *L, int t, int n) { |
no test coverage detected