X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FGC.c;h=c4823bd85c32ca8ada7a2a679d84ca03ba28f94d;hb=677c63455e46b5536800a2dc2db70b64cc802266;hp=de410168c2f1299482158bd0314f193d323a8093;hpb=03a9ff01812afc81eb5236fd3063cbec44cf469e;p=ghc-hetmet.git diff --git a/ghc/rts/GC.c b/ghc/rts/GC.c index de41016..c4823bd 100644 --- a/ghc/rts/GC.c +++ b/ghc/rts/GC.c @@ -334,7 +334,7 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc ) step *stp; lnat live, allocated, collected = 0, copied = 0, scavd_copied = 0; lnat oldgen_saved_blocks = 0; - nat g, s; + nat g, s, i; ACQUIRE_SM_LOCK; @@ -439,6 +439,10 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc ) if (g != 0) { freeChain(generations[g].mut_list); generations[g].mut_list = allocBlock(); + for (i = 0; i < n_capabilities; i++) { + freeChain(capabilities[i].mut_lists[g]); + capabilities[i].mut_lists[g] = allocBlock(); + } } for (s = 0; s < generations[g].n_steps; s++) { @@ -541,6 +545,19 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc ) stp->scavenged_large_objects = NULL; stp->n_scavenged_large_blocks = 0; } + + /* Move the private mutable lists from each capability onto the + * main mutable list for the generation. + */ + for (i = 0; i < n_capabilities; i++) { + for (bd = capabilities[i].mut_lists[g]; + bd->link != NULL; bd = bd->link) { + /* nothing */ + } + bd->link = generations[g].mut_list; + generations[g].mut_list = capabilities[i].mut_lists[g]; + capabilities[i].mut_lists[g] = allocBlock(); + } } /* Allocate a mark stack if we're doing a major collection.