aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ltests.c b/ltests.c
index 3826d424..a7882ed9 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.51 2008/06/13 17:07:10 roberto Exp roberto $ 2** $Id: ltests.c,v 2.52 2008/06/23 16:50:34 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*/
@@ -365,10 +365,15 @@ int lua_checkmemory (lua_State *L) {
365 GCObject *o; 365 GCObject *o;
366 UpVal *uv; 366 UpVal *uv;
367 checkstack(g, g->mainthread); 367 checkstack(g, g->mainthread);
368 for (o = g->rootgc; o != NULL; o = gch(o)->next) 368 for (o = g->rootgc; o != obj2gco(g->mainthread); o = gch(o)->next) {
369 lua_assert(!testbits(o->gch.marked, bit2mask(SEPARATED, SFIXEDBIT)));
369 checkobject(g, o); 370 checkobject(g, o);
370 for (o = g->tmudata; o != NULL; o = gch(o)->next) { 371 }
371 lua_assert(!isdead(g, o)); 372 lua_assert(testbit(o->gch.marked, SFIXEDBIT));
373 for (o = gch(o)->next; o != NULL; o = gch(o)->next) {
374 lua_assert(gch(o)->tt == LUA_TUSERDATA &&
375 !isdead(g, o) &&
376 testbit(o->gch.marked, SEPARATED));
372 checkobject(g, o); 377 checkobject(g, o);
373 } 378 }
374 for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) { 379 for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) {
@@ -535,7 +540,6 @@ static int gcstate (lua_State *L) {
535 switch(G(L)->gcstate) { 540 switch(G(L)->gcstate) {
536 case GCSpropagate: lua_pushstring(L, "propagate"); break; 541 case GCSpropagate: lua_pushstring(L, "propagate"); break;
537 case GCSsweepstring: lua_pushstring(L, "sweep strings"); break; 542 case GCSsweepstring: lua_pushstring(L, "sweep strings"); break;
538 case GCSsweeptmu: lua_pushstring(L, "sweep udata with __gc"); break;
539 case GCSsweep: lua_pushstring(L, "sweep"); break; 543 case GCSsweep: lua_pushstring(L, "sweep"); break;
540 case GCSfinalize: lua_pushstring(L, "finalize"); break; 544 case GCSfinalize: lua_pushstring(L, "finalize"); break;
541 default: lua_assert(0); 545 default: lua_assert(0);