aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ltests.c b/ltests.c
index 5f3b4bba..5f2cddf1 100644
--- a/ltests.c
+++ b/ltests.c
@@ -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
154static int testobjref1 (global_State *g, GCObject *f, GCObject *t) { 154static 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) {
175static int testobjref (global_State *g, GCObject *f, GCObject *t) { 175static 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
291static void checkobject (global_State *g, GCObject *o) { 292static 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))
296printf(">>> %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: {