X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FScav.c-inc;h=28aa80d1280cbbee0ba43a5884764d093a4a867f;hb=64d2f63295d25b55056c5c4698fcdb37150fbe05;hp=7b3a65f47f9bc753e936ce4ec58c5a217f125588;hpb=8058f95c14f77f887430e62bb609c1fec827fcc3;p=ghc-hetmet.git diff --git a/rts/sm/Scav.c-inc b/rts/sm/Scav.c-inc index 7b3a65f..28aa80d 100644 --- a/rts/sm/Scav.c-inc +++ b/rts/sm/Scav.c-inc @@ -1,4 +1,4 @@ -/* ----------------------------------------------------------------------------- +/* -----------------------------------------------------------------------*-c-*- * * (c) The GHC Team 1998-2006 * @@ -20,6 +20,7 @@ #else #undef scavenge_block #undef evacuate +#undef recordMutableGen_GC #endif static void scavenge_block (bdescr *bd, StgPtr scan); @@ -43,6 +44,7 @@ scavenge_block (bdescr *bd, StgPtr scan) StgInfoTable *info; step *saved_evac_step; rtsBool saved_eager_promotion; + step_workspace *ws; p = scan; @@ -54,10 +56,12 @@ scavenge_block (bdescr *bd, StgPtr scan) saved_eager_promotion = gct->eager_promotion; gct->failed_to_evac = rtsFalse; + ws = &gct->steps[bd->step->abs_no]; + // we might be evacuating into the very object that we're // scavenging, so we have to check the real bd->free pointer each // time around the loop. - while (p < bd->free) { + while (p < bd->free || (bd == ws->todo_bd && p < ws->todo_free)) { ASSERT(LOOKS_LIKE_CLOSURE_PTR(p)); info = get_itbl((StgClosure *)p); @@ -462,6 +466,10 @@ scavenge_block (bdescr *bd, StgPtr scan) } } + if (p > bd->free) { + bd->free = p; + } + debugTrace(DEBUG_gc, " scavenged %ld bytes", (unsigned long)((bd->free - scan) * sizeof(W_))); }