X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FGC.c;h=b381e56cce20b683774677e69df3ac7baa22f917;hb=4ba3cb054c3f069520f8db26591eae27560638c9;hp=8bdea7de79428c6446d3ff3f7a0f39fb7eb6538d;hpb=a370654a872838c43e63bdd6cc279c0ee9913cdf;p=ghc-hetmet.git diff --git a/rts/sm/GC.c b/rts/sm/GC.c index 8bdea7d..b381e56 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -203,6 +203,9 @@ GarbageCollect ( rtsBool force_major_gc ) } #endif + ASSERT(sizeof(step_workspace) == 16 * sizeof(StgWord)); + // otherwise adjust the padding in step_workspace. + // tell the stats department that we've started a GC stat_startGC(); @@ -250,8 +253,8 @@ GarbageCollect ( rtsBool force_major_gc ) #else n_gc_threads = 1; #endif - trace(TRACE_gc|DEBUG_gc, "GC (gen %d): %dKB to collect, using %d thread(s)", - N, n * (BLOCK_SIZE / 1024), n_gc_threads); + trace(TRACE_gc|DEBUG_gc, "GC (gen %d): %d KB to collect, %ld MB in use, using %d thread(s)", + N, n * (BLOCK_SIZE / 1024), mblocks_allocated, n_gc_threads); #ifdef RTS_GTK_FRONTPANEL if (RtsFlags.GcFlags.frontpanel) { @@ -417,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 @@ -469,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; @@ -1436,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 >