Browse Source

`defaultmeta' is always empty, but registry needs some space for
names and numbers (references)

Roberto Ierusalimschy 22 years ago
parent
commit
e75a6ae9ee
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lstate.c

+ 3 - 3
lstate.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lstate.c,v 1.118 2002/12/19 13:21:08 roberto Exp roberto $
+** $Id: lstate.c,v 1.119 2003/02/10 17:32:50 roberto Exp roberto $
 ** Global State
 ** Global State
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -111,10 +111,10 @@ static void f_luaopen (lua_State *L, void *ud) {
   stack_init(L, L);  /* init stack */
   stack_init(L, L);  /* init stack */
   /* create default meta table with a dummy table, and then close the loop */
   /* create default meta table with a dummy table, and then close the loop */
   defaultmeta(L)->tt = LUA_TTABLE;
   defaultmeta(L)->tt = LUA_TTABLE;
-  sethvalue(defaultmeta(L), luaH_new(L, 0, 4));
+  sethvalue(defaultmeta(L), luaH_new(L, 0, 0));
   hvalue(defaultmeta(L))->metatable = hvalue(defaultmeta(L));
   hvalue(defaultmeta(L))->metatable = hvalue(defaultmeta(L));
   sethvalue(gt(L), luaH_new(L, 0, 4));  /* table of globals */
   sethvalue(gt(L), luaH_new(L, 0, 4));  /* table of globals */
-  sethvalue(registry(L), luaH_new(L, 0, 0));  /* registry */
+  sethvalue(registry(L), luaH_new(L, 4, 4));  /* registry */
   luaS_resize(L, MINSTRTABSIZE);  /* initial size of string table */
   luaS_resize(L, MINSTRTABSIZE);  /* initial size of string table */
   luaT_init(L);
   luaT_init(L);
   luaX_init(L);
   luaX_init(L);