while (1) {
- ACQUIRE_SPIN_LOCK(&static_objects_sync);
-
/* get the next static object from the list. Remember, there might
* be more stuff on this list after each evacuation...
* (static_objects is a global)
*/
- p = static_objects;
+ p = gct->static_objects;
if (p == END_OF_STATIC_LIST) {
- RELEASE_SPIN_LOCK(&static_objects_sync);
break;
}
/* Take this object *off* the static_objects list,
* and put it on the scavenged_static_objects list.
*/
- static_objects = *STATIC_LINK(info,p);
- *STATIC_LINK(info,p) = scavenged_static_objects;
- scavenged_static_objects = p;
-
- RELEASE_SPIN_LOCK(&static_objects_sync);
+ gct->static_objects = *STATIC_LINK(info,p);
+ *STATIC_LINK(info,p) = gct->scavenged_static_objects;
+ gct->scavenged_static_objects = p;
switch (info -> type) {
Scavenge a block
------------------------------------------------------------------------- */
-#define MINOR_GC
+#define PARALLEL_GC
#include "Scav.c-inc"
-#undef MINOR_GC
+#undef PARALLEL_GC
#include "Scav.c-inc"
/* ----------------------------------------------------------------------------
// 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);
+ if (n_gc_threads == 1) {
+ scavenge_block1(bd, bd->start);
} else {
scavenge_block(bd, bd->start);
}
// scavenge everything up to the free pointer.
if (ws->scan != NULL && ws->scan < ws->scan_bd->free)
{
- if (N == 0) {
- scavenge_block0(ws->scan_bd, ws->scan);
+ if (n_gc_threads == 1) {
+ scavenge_block1(ws->scan_bd, ws->scan);
} else {
scavenge_block(ws->scan_bd, ws->scan);
}
work_to_do = rtsFalse;
// scavenge static objects
- if (major_gc && static_objects != END_OF_STATIC_LIST) {
- IF_DEBUG(sanity, checkStaticObjects(static_objects));
+ if (major_gc && gct->static_objects != END_OF_STATIC_LIST) {
+ IF_DEBUG(sanity, checkStaticObjects(gct->static_objects));
scavenge_static();
}
write_barrier();
- // scavenge static objects
- if (major_gc && static_objects != END_OF_STATIC_LIST) {
- return rtsTrue;
- }
-
// scavenge objects in compacted generation
if (mark_stack_overflowed || oldgen_scan_bd != NULL ||
(mark_stack_bdescr != NULL && !mark_stack_empty())) {
if (ws->stp->todos) return rtsTrue;
}
+ gct->no_work++;
+
return rtsFalse;
}