diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-03-24 10:07:01 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-03-24 10:07:01 -0300 |
| commit | 4433dbb5f5ac0bb6118bc49ddf061f194c070814 (patch) | |
| tree | 628f9da77c0cf6a80556a9c189f2528a3d7d7ca4 /ltests.c | |
| parent | 5cb128ea540b33dbc6be659d5dfc3c64c57d78d9 (diff) | |
| download | lua-4433dbb5f5ac0bb6118bc49ddf061f194c070814.tar.gz lua-4433dbb5f5ac0bb6118bc49ddf061f194c070814.tar.bz2 lua-4433dbb5f5ac0bb6118bc49ddf061f194c070814.zip | |
userdata with finalizers are kept in a separated list ('udgc'), instead
of at the end of 'rootgc' (which was renamed to 'allgc', as it is not
"root" in the usual meaning for collectors)
Diffstat (limited to 'ltests.c')
| -rw-r--r-- | ltests.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 2.86 2009/12/22 15:32:50 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.87 2010/01/13 16:18:25 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -188,7 +188,7 @@ static int testobjref1 (global_State *g, GCObject *f, GCObject *t) { | |||
| 188 | static void printobj (global_State *g, GCObject *o) { | 188 | static void printobj (global_State *g, GCObject *o) { |
| 189 | int i = 0; | 189 | int i = 0; |
| 190 | GCObject *p; | 190 | GCObject *p; |
| 191 | for (p = g->rootgc; p != o && p != NULL; p = gch(p)->next) i++; | 191 | for (p = g->allgc; p != o && p != NULL; p = gch(p)->next) i++; |
| 192 | if (p == NULL) i = -1; | 192 | if (p == NULL) i = -1; |
| 193 | printf("%d:%s(%p)-%c(%02X)", i, typename(gch(o)->tt), (void *)o, | 193 | printf("%d:%s(%p)-%c(%02X)", i, typename(gch(o)->tt), (void *)o, |
| 194 | isdead(g,o)?'d':isblack(o)?'b':iswhite(o)?'w':'g', gch(o)->marked); | 194 | isdead(g,o)?'d':isblack(o)?'b':iswhite(o)?'w':'g', gch(o)->marked); |
| @@ -375,12 +375,12 @@ int lua_checkmemory (lua_State *L) { | |||
| 375 | checkliveness(g, &g->l_registry); | 375 | checkliveness(g, &g->l_registry); |
| 376 | lua_assert(!isdead(g, obj2gco(g->l_gt))); | 376 | lua_assert(!isdead(g, obj2gco(g->l_gt))); |
| 377 | checkstack(g, g->mainthread); | 377 | checkstack(g, g->mainthread); |
| 378 | for (o = g->rootgc; o != obj2gco(g->mainthread); o = gch(o)->next) { | 378 | for (o = g->allgc; o != obj2gco(g->mainthread); o = gch(o)->next) { |
| 379 | lua_assert(!testbits(o->gch.marked, bit2mask(SEPARATED, SFIXEDBIT))); | 379 | lua_assert(!testbits(o->gch.marked, bit2mask(SEPARATED, SFIXEDBIT))); |
| 380 | checkobject(g, o); | 380 | checkobject(g, o); |
| 381 | } | 381 | } |
| 382 | lua_assert(testbit(o->gch.marked, SFIXEDBIT)); | 382 | lua_assert(testbit(o->gch.marked, SFIXEDBIT)); |
| 383 | for (o = gch(o)->next; o != NULL; o = gch(o)->next) { | 383 | for (o = g->udgc; o != NULL; o = gch(o)->next) { |
| 384 | lua_assert(gch(o)->tt == LUA_TUSERDATA && | 384 | lua_assert(gch(o)->tt == LUA_TUSERDATA && |
| 385 | !isdead(g, o) && | 385 | !isdead(g, o) && |
| 386 | testbit(o->gch.marked, SEPARATED)); | 386 | testbit(o->gch.marked, SEPARATED)); |
