diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-08-30 16:09:21 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-08-30 16:09:21 -0300 |
| commit | fdafd4f4a88d1584dea900517445a17d87f8b82f (patch) | |
| tree | 52e38e886d569e77c1df82ebe2bcfbaafd4c6f75 /ltable.c | |
| parent | beeff4ccafe5877d00119cb3d93f1f937d46dcfb (diff) | |
| download | lua-fdafd4f4a88d1584dea900517445a17d87f8b82f.tar.gz lua-fdafd4f4a88d1584dea900517445a17d87f8b82f.tar.bz2 lua-fdafd4f4a88d1584dea900517445a17d87f8b82f.zip | |
new structure for collectable objects, sharing a common header
Diffstat (limited to 'ltable.c')
| -rw-r--r-- | ltable.c | 7 |
1 files changed, 3 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.c,v 1.116 2002/08/06 17:06:56 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 1.117 2002/08/16 14:45:55 roberto Exp roberto $ |
| 3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | #include "ldebug.h" | 28 | #include "ldebug.h" |
| 29 | #include "ldo.h" | 29 | #include "ldo.h" |
| 30 | #include "lgc.h" | ||
| 30 | #include "lmem.h" | 31 | #include "lmem.h" |
| 31 | #include "lobject.h" | 32 | #include "lobject.h" |
| 32 | #include "lstate.h" | 33 | #include "lstate.h" |
| @@ -304,11 +305,9 @@ static void rehash (lua_State *L, Table *t) { | |||
| 304 | 305 | ||
| 305 | Table *luaH_new (lua_State *L, int narray, int lnhash) { | 306 | Table *luaH_new (lua_State *L, int narray, int lnhash) { |
| 306 | Table *t = luaM_new(L, Table); | 307 | Table *t = luaM_new(L, Table); |
| 308 | luaC_link(L, cast(GCObject *, t), LUA_TTABLE); | ||
| 307 | t->metatable = hvalue(defaultmeta(L)); | 309 | t->metatable = hvalue(defaultmeta(L)); |
| 308 | t->next = G(L)->roottable; | ||
| 309 | G(L)->roottable = t; | ||
| 310 | t->flags = cast(lu_byte, ~0); | 310 | t->flags = cast(lu_byte, ~0); |
| 311 | t->marked = 0; | ||
| 312 | t->mode = 0; | 311 | t->mode = 0; |
| 313 | /* temporary values (kept only if some malloc fails) */ | 312 | /* temporary values (kept only if some malloc fails) */ |
| 314 | t->array = NULL; | 313 | t->array = NULL; |
