From 1e81da51bab87148981486a84b846399050f4ef2 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 17 Oct 2001 19:12:57 -0200 Subject: new API for registry and C upvalues + new implementation for references --- lstate.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index 4b404b0b..640bfcde 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 1.66 2001/07/17 17:54:46 roberto Exp $ +** $Id: lstate.c,v 1.68 2001/09/07 17:39:10 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ @@ -66,10 +66,7 @@ static void f_luaopen (lua_State *L, void *ud) { luaD_init(L, so->stacksize); /* init stack */ L->gt = luaH_new(L, 10); /* table of globals */ G(L)->type2tag = luaH_new(L, 10); - G(L)->registry = luaH_new(L, 0); - G(L)->weakregistry = luaH_new(L, 0); - /* make weakregistry weak */ - G(L)->weakregistry->weakmode = LUA_WEAK_KEY | LUA_WEAK_VALUE; + sethvalue(&G(L)->registry, luaH_new(L, 0)); luaS_resize(L, MINPOWER2); luaX_init(L); luaT_init(L); -- cgit v1.2.3-55-g6feb