summaryrefslogtreecommitdiff
path: root/rts/sm/GC.c
diff options
context:
space:
mode:
authorSimon Marlow <simonmarhaskell@gmail.com>2008-04-16 23:25:10 +0000
committerSimon Marlow <simonmarhaskell@gmail.com>2008-04-16 23:25:10 +0000
commitd564f41560f25c15cd971f167a3c2091f7a05e3f (patch)
treed1a5de4b203a7c37b18051939f5e855463814dd6 /rts/sm/GC.c
parente686d8dc6cd67c35132059d0718d1501f0af1e67 (diff)
downloadhaskell-d564f41560f25c15cd971f167a3c2091f7a05e3f.tar.gz
make +RTS -G1 work again
Diffstat (limited to 'rts/sm/GC.c')
-rw-r--r--rts/sm/GC.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 2b6dbb7dd2..cf6f80715c 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -420,7 +420,12 @@ GarbageCollect ( rtsBool force_major_gc )
thr = gc_threads[t];
// not step 0
- for (s = 1; s < total_steps; s++) {
+ if (RtsFlags.GcFlags.generations == 1) {
+ s = 0;
+ } else {
+ s = 1;
+ }
+ for (; s < total_steps; s++) {
ws = &thr->steps[s];
// Push the final block
@@ -472,19 +477,6 @@ GarbageCollect ( rtsBool force_major_gc )
}
}
- // Two-space collector: swap the semi-spaces around.
- // Currently: g0s0->old_blocks is the old nursery
- // g0s0->blocks is to-space from this GC
- // We want these the other way around.
- if (RtsFlags.GcFlags.generations == 1) {
- bdescr *nursery_blocks = g0s0->old_blocks;
- nat n_nursery_blocks = g0s0->n_old_blocks;
- g0s0->old_blocks = g0s0->blocks;
- g0s0->n_old_blocks = g0s0->n_blocks;
- g0s0->blocks = nursery_blocks;
- g0s0->n_blocks = n_nursery_blocks;
- }
-
/* run through all the generations/steps and tidy up
*/
copied = 0;
@@ -1439,7 +1431,7 @@ resize_nursery (void)
* performance we get from 3L bytes, reducing to the same
* performance at 2L bytes.
*/
- blocks = g0s0->n_old_blocks;
+ blocks = g0s0->n_blocks;
if ( RtsFlags.GcFlags.maxHeapSize != 0 &&
blocks * RtsFlags.GcFlags.oldGenFactor * 2 >