bugfix around GC

This commit is contained in:
Yuichi Nishiwaki 2013-10-15 08:58:23 +09:00
parent 6bd38273d2
commit 528c2e2c15
1 changed files with 6 additions and 1 deletions

View File

@ -231,6 +231,8 @@ gc_sweep_phase(pic_state *pic)
puts("sweeping block"); puts("sweeping block");
#endif #endif
retry:
for (bp = p + p->s.size; bp != p->s.ptr; bp += bp->s.size) { for (bp = p + p->s.size; bp != p->s.ptr; bp += bp->s.size) {
#if GC_DEBUG #if GC_DEBUG
@ -270,8 +272,11 @@ gc_sweep_phase(pic_state *pic)
} }
else { else {
p->s.ptr = bp; p->s.ptr = bp;
/* retry with next p */
p = p->s.ptr;
} }
break;
goto retry;
} }
} }
} }