fully-weak tables are more efficient

This commit is contained in:
Roberto Ierusalimschy 2003-05-16 15:59:08 -03:00
parent ecf5730c0c
commit 60aa01d8f7
2 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lauxlib.c,v 1.100 2003/04/07 14:35:00 roberto Exp roberto $ ** $Id: lauxlib.c,v 1.101 2003/05/15 12:20:24 roberto Exp roberto $
** Auxiliary functions for building Lua libraries ** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -271,8 +271,8 @@ static void getsizes (lua_State *L) {
lua_pushvalue(L, -1); /* `size' will be its own metatable */ lua_pushvalue(L, -1); /* `size' will be its own metatable */
lua_setmetatable(L, -2); lua_setmetatable(L, -2);
lua_pushliteral(L, "__mode"); lua_pushliteral(L, "__mode");
lua_pushliteral(L, "k"); lua_pushliteral(L, "kv");
lua_rawset(L, -3); /* metatable(N).__mode = "k" */ lua_rawset(L, -3); /* metatable(N).__mode = "kv" */
lua_pushvalue(L, -1); lua_pushvalue(L, -1);
lua_rawseti(L, LUA_REGISTRYINDEX, ARRAYSIZE_REF); /* store in register */ lua_rawseti(L, LUA_REGISTRYINDEX, ARRAYSIZE_REF); /* store in register */
} }

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lbaselib.c,v 1.129 2003/03/19 21:14:34 roberto Exp roberto $ ** $Id: lbaselib.c,v 1.130 2003/04/03 13:35:34 roberto Exp roberto $
** Basic library ** Basic library
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -656,8 +656,8 @@ static void base_open (lua_State *L) {
lua_pushvalue(L, -1); /* `w' will be its own metatable */ lua_pushvalue(L, -1); /* `w' will be its own metatable */
lua_setmetatable(L, -2); lua_setmetatable(L, -2);
lua_pushliteral(L, "__mode"); lua_pushliteral(L, "__mode");
lua_pushliteral(L, "k"); lua_pushliteral(L, "kv");
lua_rawset(L, -3); /* metatable(w).__mode = "k" */ lua_rawset(L, -3); /* metatable(w).__mode = "kv" */
lua_pushcclosure(L, luaB_newproxy, 1); lua_pushcclosure(L, luaB_newproxy, 1);
lua_rawset(L, -3); /* set global `newproxy' */ lua_rawset(L, -3); /* set global `newproxy' */
lua_rawset(L, -1); /* set global _G */ lua_rawset(L, -1); /* set global _G */