X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FScav.c;h=f92ef494a5e32f037f8fe0ce0674dc1df3081640;hb=4fbd33e52e8ac6b4210b5006d05dbb1e9608ddb1;hp=0eb4b11d897c208f0601ffd4cdbe0499bfc207e5;hpb=a75a8790410ce3ffb439bfd0b7c3999e7df72eb1;p=ghc-hetmet.git diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index 0eb4b11..f92ef49 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -1432,44 +1432,20 @@ loop: } ws = &gct->steps[s]; - if (ws->todo_bd != NULL) - { - bd = ws->todo_bd; - gct->copied += ws->todo_free - bd->free; - bd->free = ws->todo_free; - } + gct->scan_bd = NULL; - // If we have a todo block and no scan block, start - // scanning the todo block. - if (ws->scan_bd == NULL && ws->todo_bd != NULL) - { - ws->scan_bd = ws->todo_bd; - } - // If we have a scan block with some work to do, // scavenge everything up to the free pointer. - if (ws->scan_bd != NULL && ws->scan_bd->u.scan < ws->scan_bd->free) + if (ws->todo_bd->u.scan < ws->todo_free) { if (n_gc_threads == 1) { - scavenge_block1(ws->scan_bd); + scavenge_block1(ws->todo_bd); } else { - scavenge_block(ws->scan_bd); + scavenge_block(ws->todo_bd); } did_something = rtsTrue; + break; } - - if (ws->scan_bd != NULL && ws->scan_bd != ws->todo_bd) - { - ASSERT(ws->scan_bd->u.scan == ws->scan_bd->free); - // we're not going to evac any more objects into - // this block, so push it now. - push_scanned_block(ws->scan_bd, ws); - ws->scan_bd = NULL; - // we might be able to scan the todo block now. - did_something = rtsTrue; - } - - if (did_something) break; // If we have any large objects to scavenge, do them now. if (ws->todo_large_objects) { @@ -1479,16 +1455,11 @@ loop: } if ((bd = grab_todo_block(ws)) != NULL) { - // no need to assign this to ws->scan_bd, we're going - // to scavenge the whole thing and then push it on - // our scavd list. This saves pushing out the - // scan_bd block, which might be partial. if (n_gc_threads == 1) { scavenge_block1(bd); } else { scavenge_block(bd); } - push_scanned_block(bd, ws); did_something = rtsTrue; break; }