X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FScav.c-inc;h=bff193be7c7bdc7ca1304475388f044b33b455b1;hb=9de1ad504a0a12dabd42b206f06ca04fa0e7009a;hp=6f852035b5d1a75e5894ec9411d98a50d15146ff;hpb=dbbf15c0f141357aa49b583286174867baadb821;p=ghc-hetmet.git diff --git a/rts/sm/Scav.c-inc b/rts/sm/Scav.c-inc index 6f85203..bff193b 100644 --- a/rts/sm/Scav.c-inc +++ b/rts/sm/Scav.c-inc @@ -1,6 +1,6 @@ /* -----------------------------------------------------------------------*-c-*- * - * (c) The GHC Team 1998-2006 + * (c) The GHC Team 1998-2008 * * Generational garbage collector: scavenging functions * @@ -47,11 +47,10 @@ scavenge_block (bdescr *bd) rtsBool saved_eager_promotion; step_workspace *ws; - p = bd->u.scan; - debugTrace(DEBUG_gc, "scavenging block %p (gen %d, step %d) @ %p", - bd->start, bd->gen_no, bd->step->no, p); + bd->start, bd->gen_no, bd->step->no, bd->u.scan); + gct->scan_bd = bd; gct->evac_step = bd->step; saved_evac_step = gct->evac_step; saved_eager_promotion = gct->eager_promotion; @@ -59,6 +58,8 @@ scavenge_block (bdescr *bd) ws = &gct->steps[bd->step->abs_no]; + p = bd->u.scan; + // 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. @@ -444,16 +445,24 @@ scavenge_block (bdescr *bd) } if (p > bd->free) { + gct->copied += ws->todo_free - bd->free; bd->free = p; } debugTrace(DEBUG_gc, " scavenged %ld bytes", (unsigned long)((bd->free - bd->u.scan) * sizeof(W_))); - // update stats: this is a block that has been copied & scavenged - gct->copied += bd->free - bd->u.scan; - + // update stats: this is a block that has been scavenged + gct->scanned += bd->free - bd->u.scan; bd->u.scan = bd->free; + + if (bd != ws->todo_bd) { + // we're not going to evac any more objects into + // this block, so push it now. + push_scanned_block(bd, ws); + } + + gct->scan_bd = NULL; } #undef scavenge_block