- flag = rtsFalse;
- for (g = RtsFlags.GcFlags.generations-1; g >= 0; g--) {
- for (s = generations[g].n_steps-1; s >= 0; s--) {
- if (g == 0 && s == 0 && RtsFlags.GcFlags.generations > 1) {
- continue;
- }
- ws = &gct->steps[g][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 == 0) {
- scavenge_block0(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.
- ------------------------------------------------------------------------- */