summaryrefslogtreecommitdiff
path: root/rts/sm/BlockAlloc.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-12-03 15:07:28 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-12-03 15:07:28 +0000
commit214b3663d5d7598c13643f9221e43d5a7735b47f (patch)
treede779bab8dbcf057eaf481e6b612b63881e246e9 /rts/sm/BlockAlloc.c
parent7cb1d9274e84ee2fc2dd610aa4f7686586ca0357 (diff)
downloadhaskell-214b3663d5d7598c13643f9221e43d5a7735b47f.tar.gz
GC refactoring, remove "steps"
The GC had a two-level structure, G generations each of T steps. Steps are for aging within a generation, mostly to avoid premature promotion. Measurements show that more than 2 steps is almost never worthwhile, and 1 step is usually worse than 2. In theory fractional steps are possible, so the ideal number of steps is somewhere between 1 and 3. GHC's default has always been 2. We can implement 2 steps quite straightforwardly by having each block point to the generation to which objects in that block should be promoted, so blocks in the nursery point to generation 0, and blocks in gen 0 point to gen 1, and so on. This commit removes the explicit step structures, merging generations with steps, thus simplifying a lot of code. Performance is unaffected. The tunable number of steps is now gone, although it may be replaced in the future by a way to tune the aging in generation 0.
Diffstat (limited to 'rts/sm/BlockAlloc.c')
-rw-r--r--rts/sm/BlockAlloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c
index 898624a267..edc37620bd 100644
--- a/rts/sm/BlockAlloc.c
+++ b/rts/sm/BlockAlloc.c
@@ -58,7 +58,7 @@ static void initMBlock(void *mblock);
The following fields are not used by the allocator:
bd->flags
bd->gen_no
- bd->step
+ bd->gen
bd->dest
Exceptions: we don't maintain invariants for all the blocks within a
@@ -470,7 +470,7 @@ freeGroup(bdescr *p)
ASSERT(p->free != (P_)-1);
p->free = (void *)-1; /* indicates that this block is free */
- p->step = NULL;
+ p->gen = NULL;
p->gen_no = 0;
/* fill the block group with garbage if sanity checking is on */
IF_DEBUG(sanity,memset(p->start, 0xaa, p->blocks * BLOCK_SIZE));