summaryrefslogtreecommitdiff
path: root/ghc/rts/GCCompact.c
diff options
context:
space:
mode:
authorsimonmar <unknown>2005-07-25 13:59:10 +0000
committersimonmar <unknown>2005-07-25 13:59:10 +0000
commit085d1c545c6578d5756d41f956c049274ce7eaa6 (patch)
tree3f3521241aa4fa015130eb2f5558234c45b8e549 /ghc/rts/GCCompact.c
parenta91e31661ea6a68e8e9f0eaac474965b70f563f1 (diff)
downloadhaskell-085d1c545c6578d5756d41f956c049274ce7eaa6.tar.gz
[project @ 2005-07-25 13:59:09 by simonmar]
Tweaks to the GC to improve perforrmance. Might be as much as 10% on some programs.
Diffstat (limited to 'ghc/rts/GCCompact.c')
-rw-r--r--ghc/rts/GCCompact.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/ghc/rts/GCCompact.c b/ghc/rts/GCCompact.c
index 549a27c50a..ad7638dfd3 100644
--- a/ghc/rts/GCCompact.c
+++ b/ghc/rts/GCCompact.c
@@ -842,7 +842,7 @@ update_bkwd_compact( step *stp )
StgInfoTable *info;
nat size, free_blocks;
- bd = free_bd = stp->blocks;
+ bd = free_bd = stp->old_blocks;
free = free_bd->start;
free_blocks = 1;
@@ -917,7 +917,7 @@ update_bkwd_compact( step *stp )
freeChain(free_bd->link);
free_bd->link = NULL;
}
- stp->n_blocks = free_blocks;
+ stp->n_old_blocks = free_blocks;
return free_blocks;
}
@@ -976,25 +976,26 @@ compact( void (*get_roots)(evac_fn) )
// 2. update forward ptrs
for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
for (s = 0; s < generations[g].n_steps; s++) {
+ if (g==0 && s ==0) continue;
stp = &generations[g].steps[s];
IF_DEBUG(gc, debugBelch("update_fwd: %d.%d\n", stp->gen->no, stp->no););
- update_fwd(stp->to_blocks);
+ update_fwd(stp->blocks);
update_fwd_large(stp->scavenged_large_objects);
- if (g == RtsFlags.GcFlags.generations-1 && stp->blocks != NULL) {
+ if (g == RtsFlags.GcFlags.generations-1 && stp->old_blocks != NULL) {
IF_DEBUG(gc, debugBelch("update_fwd: %d.%d (compact)\n", stp->gen->no, stp->no););
- update_fwd_compact(stp->blocks);
+ update_fwd_compact(stp->old_blocks);
}
}
}
// 3. update backward ptrs
stp = &oldest_gen->steps[0];
- if (stp->blocks != NULL) {
+ if (stp->old_blocks != NULL) {
blocks = update_bkwd_compact(stp);
IF_DEBUG(gc, debugBelch("update_bkwd: %d.%d (compact, old: %d blocks, now %d blocks)\n",
stp->gen->no, stp->no,
- stp->n_blocks, blocks););
- stp->n_blocks = blocks;
+ stp->n_old_blocks, blocks););
+ stp->n_old_blocks = blocks;
}
}