X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FGCUtils.c;h=57cede7d43390dc4605404792b1d212278e61fd6;hb=de75026f5a48d3d052135a973ab4dff76c5b20f5;hp=84b7564980f4c927496dba657b4ff8012ff0ac28;hpb=4e3542263207ae49963811aeb84927027e7bb61d;p=ghc-hetmet.git diff --git a/rts/sm/GCUtils.c b/rts/sm/GCUtils.c index 84b7564..57cede7 100644 --- a/rts/sm/GCUtils.c +++ b/rts/sm/GCUtils.c @@ -149,8 +149,13 @@ push_scanned_block (bdescr *bd, step_workspace *ws) StgPtr todo_block_full (nat size, step_workspace *ws) { + StgPtr p; bdescr *bd; + // todo_free has been pre-incremented by Evac.c:alloc_for_copy(). We + // are expected to leave it bumped when we've finished here. + ws->todo_free -= size; + bd = ws->todo_bd; ASSERT(bd != NULL); @@ -167,7 +172,9 @@ todo_block_full (nat size, step_workspace *ws) ws->todo_lim = stg_min(bd->start + BLOCK_SIZE_W, ws->todo_lim + stg_max(WORK_UNIT_WORDS,size)); debugTrace(DEBUG_gc, "increasing limit for %p to %p", bd->start, ws->todo_lim); - return ws->todo_free; + p = ws->todo_free; + ws->todo_free += size; + return p; } } @@ -194,7 +201,7 @@ todo_block_full (nat size, step_workspace *ws) { step *stp; stp = ws->step; - trace(TRACE_gc|DEBUG_gc, "push todo block %p (%ld words), step %d, todo_q: %ld", + debugTrace(DEBUG_gc, "push todo block %p (%ld words), step %d, todo_q: %ld", bd->start, (unsigned long)(bd->free - bd->u.scan), stp->abs_no, dequeElements(ws->todo_q)); @@ -212,7 +219,9 @@ todo_block_full (nat size, step_workspace *ws) alloc_todo_block(ws, size); - return ws->todo_free; + p = ws->todo_free; + ws->todo_free += size; + return p; } StgPtr