[commit: ghc] master: fix compacting GC (367d9a0)
Simon Marlow
marlowsd at gmail.com
Thu Feb 3 21:39:22 CET 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/367d9a0f37b3be938d14c650434beee3c79814fe
>---------------------------------------------------------------
commit 367d9a0f37b3be938d14c650434beee3c79814fe
Author: Simon Marlow <marlowsd at gmail.com>
Date: Wed Feb 2 17:00:36 2011 +0000
fix compacting GC
>---------------------------------------------------------------
rts/sm/Compact.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/rts/sm/Compact.c b/rts/sm/Compact.c
index eceaba4..ff7480c 100644
--- a/rts/sm/Compact.c
+++ b/rts/sm/Compact.c
@@ -14,6 +14,7 @@
#include "PosixSource.h"
#include "Rts.h"
+#include "GCThread.h"
#include "Storage.h"
#include "RtsUtils.h"
#include "BlockAlloc.h"
@@ -935,7 +936,7 @@ update_bkwd_compact( generation *gen )
void
compact(StgClosure *static_objects)
{
- nat g, blocks;
+ nat n, g, blocks;
generation *gen;
// 1. thread the roots
@@ -953,7 +954,6 @@ compact(StgClosure *static_objects)
for (g = 1; g < RtsFlags.GcFlags.generations; g++) {
bdescr *bd;
StgPtr p;
- nat n;
for (n = 0; n < n_capabilities; n++) {
for (bd = capabilities[n].mut_lists[g];
bd != NULL; bd = bd->link) {
@@ -1001,6 +1001,10 @@ compact(StgClosure *static_objects)
debugTrace(DEBUG_gc, "update_fwd: %d", g);
update_fwd(gen->blocks);
+ for (n = 0; n < n_capabilities; n++) {
+ update_fwd(gc_threads[n]->gens[g].todo_bd);
+ update_fwd(gc_threads[n]->gens[g].part_list);
+ }
update_fwd_large(gen->scavenged_large_objects);
if (g == RtsFlags.GcFlags.generations-1 && gen->old_blocks != NULL) {
debugTrace(DEBUG_gc, "update_fwd: %d (compact)", g);
More information about the Cvs-ghc
mailing list