diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-02-13 14:07:57 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-02-13 14:07:57 -0200 |
| commit | e75a6ae9eee8f990b6c06c533b7b3a2afba6e0f2 (patch) | |
| tree | d577f5e496f16c0f7f489fdf4dede345aac27568 | |
| parent | 2866fb2dd0412b8ff1b605722c547f2548716ad3 (diff) | |
| download | lua-e75a6ae9eee8f990b6c06c533b7b3a2afba6e0f2.tar.gz lua-e75a6ae9eee8f990b6c06c533b7b3a2afba6e0f2.tar.bz2 lua-e75a6ae9eee8f990b6c06c533b7b3a2afba6e0f2.zip | |
`defaultmeta' is always empty, but registry needs some space for
names and numbers (references)
| -rw-r--r-- | lstate.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstate.c,v 1.118 2002/12/19 13:21:08 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 1.119 2003/02/10 17:32:50 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 | */ |
| @@ -111,10 +111,10 @@ static void f_luaopen (lua_State *L, void *ud) { | |||
| 111 | stack_init(L, L); /* init stack */ | 111 | stack_init(L, L); /* init stack */ |
| 112 | /* create default meta table with a dummy table, and then close the loop */ | 112 | /* create default meta table with a dummy table, and then close the loop */ |
| 113 | defaultmeta(L)->tt = LUA_TTABLE; | 113 | defaultmeta(L)->tt = LUA_TTABLE; |
| 114 | sethvalue(defaultmeta(L), luaH_new(L, 0, 4)); | 114 | sethvalue(defaultmeta(L), luaH_new(L, 0, 0)); |
| 115 | hvalue(defaultmeta(L))->metatable = hvalue(defaultmeta(L)); | 115 | hvalue(defaultmeta(L))->metatable = hvalue(defaultmeta(L)); |
| 116 | sethvalue(gt(L), luaH_new(L, 0, 4)); /* table of globals */ | 116 | sethvalue(gt(L), luaH_new(L, 0, 4)); /* table of globals */ |
| 117 | sethvalue(registry(L), luaH_new(L, 0, 0)); /* registry */ | 117 | sethvalue(registry(L), luaH_new(L, 4, 4)); /* registry */ |
| 118 | luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ | 118 | luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ |
| 119 | luaT_init(L); | 119 | luaT_init(L); |
| 120 | luaX_init(L); | 120 | luaX_init(L); |
