diff options
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 1.128 2003/11/18 14:55:11 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 1.129 2003/12/01 16:33:30 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 | */ |
@@ -76,10 +76,6 @@ static void freestack (lua_State *L, lua_State *L1) { | |||
76 | static void f_luaopen (lua_State *L, void *ud) { | 76 | static void f_luaopen (lua_State *L, void *ud) { |
77 | UNUSED(ud); | 77 | UNUSED(ud); |
78 | stack_init(L, L); /* init stack */ | 78 | stack_init(L, L); /* init stack */ |
79 | /* create default meta table with a dummy table, and then close the loop */ | ||
80 | defaultmeta(L)->tt = LUA_TTABLE; | ||
81 | sethvalue(defaultmeta(L), luaH_new(L, 0, 0)); | ||
82 | hvalue(defaultmeta(L))->metatable = hvalue(defaultmeta(L)); | ||
83 | sethvalue(gt(L), luaH_new(L, 0, 4)); /* table of globals */ | 79 | sethvalue(gt(L), luaH_new(L, 0, 4)); /* table of globals */ |
84 | sethvalue(registry(L), luaH_new(L, 4, 4)); /* registry */ | 80 | sethvalue(registry(L), luaH_new(L, 4, 4)); /* registry */ |
85 | luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ | 81 | luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ |
@@ -161,7 +157,6 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | |||
161 | g->strt.size = 0; | 157 | g->strt.size = 0; |
162 | g->strt.nuse = 0; | 158 | g->strt.nuse = 0; |
163 | g->strt.hash = NULL; | 159 | g->strt.hash = NULL; |
164 | setnilvalue(defaultmeta(L)); | ||
165 | setnilvalue(registry(L)); | 160 | setnilvalue(registry(L)); |
166 | luaZ_initbuffer(L, &g->buff); | 161 | luaZ_initbuffer(L, &g->buff); |
167 | g->panic = NULL; | 162 | g->panic = NULL; |