diff options
Diffstat (limited to 'ltests.c')
| -rw-r--r-- | ltests.c | 16 |
1 files changed, 10 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 2.9 2004/06/02 19:08:52 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.10 2004/07/09 18:23:17 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 | */ |
| @@ -153,9 +153,9 @@ void *debug_realloc (void *ud, void *block, size_t oldsize, size_t size) { | |||
| 153 | 153 | ||
| 154 | static int testobjref1 (global_State *g, GCObject *f, GCObject *t) { | 154 | static int testobjref1 (global_State *g, GCObject *f, GCObject *t) { |
| 155 | if (isdead(g,t)) return 0; | 155 | if (isdead(g,t)) return 0; |
| 156 | if (g->gcstate == GCSpropagate) | 156 | if (g->gcstate == GCSpropagate || g->gcgenerational) |
| 157 | return !isblack(f) || !iswhite(t); | 157 | return !isblack(f) || !iswhite(t); |
| 158 | else if (g->gcstate == GCSfinalize) | 158 | else if (g->gcstate == GCSfinalize && !g->gcgenerational) |
| 159 | return iswhite(f); | 159 | return iswhite(f); |
| 160 | else | 160 | else |
| 161 | return 1; | 161 | return 1; |
| @@ -175,7 +175,8 @@ static void printobj (global_State *g, GCObject *o) { | |||
| 175 | static int testobjref (global_State *g, GCObject *f, GCObject *t) { | 175 | static int testobjref (global_State *g, GCObject *f, GCObject *t) { |
| 176 | int r = testobjref1(g,f,t); | 176 | int r = testobjref1(g,f,t); |
| 177 | if (!r) { | 177 | if (!r) { |
| 178 | printf("%d(%02X) - ", g->gcstate, g->currentwhite); | 178 | printf("%d(%02X) %c - ", g->gcstate, g->currentwhite, |
| 179 | g->gcgenerational ? 'G' : ' '); | ||
| 179 | printobj(g, f); | 180 | printobj(g, f); |
| 180 | printf("\t-> "); | 181 | printf("\t-> "); |
| 181 | printobj(g, t); | 182 | printobj(g, t); |
| @@ -290,9 +291,12 @@ static void checkstack (global_State *g, lua_State *L1) { | |||
| 290 | 291 | ||
| 291 | static void checkobject (global_State *g, GCObject *o) { | 292 | static void checkobject (global_State *g, GCObject *o) { |
| 292 | if (isdead(g, o)) | 293 | if (isdead(g, o)) |
| 293 | lua_assert(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep); | 294 | /* lua_assert(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep);*/ |
| 295 | { if (!(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep)) | ||
| 296 | printf(">>> %d %s %02x\n", g->gcstate, luaT_typenames[o->gch.tt], o->gch.marked); | ||
| 297 | } | ||
| 294 | else { | 298 | else { |
| 295 | if (g->gcstate == GCSfinalize) | 299 | if (g->gcstate == GCSfinalize && !g->gcgenerational) |
| 296 | lua_assert(iswhite(o)); | 300 | lua_assert(iswhite(o)); |
| 297 | switch (o->gch.tt) { | 301 | switch (o->gch.tt) { |
| 298 | case LUA_TUPVAL: { | 302 | case LUA_TUPVAL: { |
