diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-07-17 14:54:46 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-07-17 14:54:46 -0300 |
commit | d8f37bf42a3dc05bf3b6f1c658ee1024116abcf2 (patch) | |
tree | 47d6c2517217c9b02dd32793a607911948928001 | |
parent | a598804a0435a53538c8ab6c74182347b797ae9b (diff) | |
download | lua-d8f37bf42a3dc05bf3b6f1c658ee1024116abcf2.tar.gz lua-d8f37bf42a3dc05bf3b6f1c658ee1024116abcf2.tar.bz2 lua-d8f37bf42a3dc05bf3b6f1c658ee1024116abcf2.zip |
weakregistry has its keys weak, too
-rw-r--r-- | lstate.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 1.64 2001/06/12 18:43:13 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 1.65 2001/06/21 16:41:34 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -67,7 +67,8 @@ static void f_luaopen (lua_State *L, void *ud) { | |||
67 | G(L)->type2tag = luaH_new(L, 10); | 67 | G(L)->type2tag = luaH_new(L, 10); |
68 | G(L)->registry = luaH_new(L, 0); | 68 | G(L)->registry = luaH_new(L, 0); |
69 | G(L)->weakregistry = luaH_new(L, 0); | 69 | G(L)->weakregistry = luaH_new(L, 0); |
70 | G(L)->weakregistry->weakmode = LUA_WEAK_VALUE; /* make weakregistry weak */ | 70 | /* make weakregistry weak */ |
71 | G(L)->weakregistry->weakmode = LUA_WEAK_KEY | LUA_WEAK_VALUE; | ||
71 | luaS_resize(L, MINPOWER2); | 72 | luaS_resize(L, MINPOWER2); |
72 | luaX_init(L); | 73 | luaX_init(L); |
73 | luaT_init(L); | 74 | luaT_init(L); |