-
- gct->scav_global_work++;
-
- flag = rtsFalse;
- for (s = total_steps-1; s>=0; s--)
- {
- if (s == 0 && RtsFlags.GcFlags.generations > 1) {
- continue;
- }
- ws = &gct->steps[s];
-
- // If we have any large objects to scavenge, do them now.
- if (ws->todo_large_objects) {
- scavenge_large(ws);
- flag = rtsTrue;
- }
-
- 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, bd->start);
- } else {
- scavenge_block(bd, bd->start);
- }
- push_scan_block(bd, ws);
- return rtsTrue;
- }
-
- if (flag) return rtsTrue;
- }
- return rtsFalse;
-}
-
-/* ----------------------------------------------------------------------------
- Look for local work to do.
-
- We can have outstanding scavenging to do if, for any of the workspaces,
-
- - the scan block is the same as the todo block, and new objects
- have been evacuated to the todo block.
-
- - the scan block *was* the same as the todo block, but the todo
- block filled up and a new one has been allocated.
- ------------------------------------------------------------------------- */
-
-static rtsBool
-scavenge_find_local_work (void)
-{
- int s;
- step_workspace *ws;
- rtsBool flag;