diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-12-03 15:07:28 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-12-03 15:07:28 +0000 |
commit | 214b3663d5d7598c13643f9221e43d5a7735b47f (patch) | |
tree | de779bab8dbcf057eaf481e6b612b63881e246e9 /rts/sm/Storage.h | |
parent | 7cb1d9274e84ee2fc2dd610aa4f7686586ca0357 (diff) | |
download | haskell-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/Storage.h')
-rw-r--r-- | rts/sm/Storage.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/sm/Storage.h b/rts/sm/Storage.h index 02f5637515..6dbccd8910 100644 --- a/rts/sm/Storage.h +++ b/rts/sm/Storage.h @@ -29,7 +29,7 @@ INLINE_HEADER rtsBool doYouWantToGC( Capability *cap ) { return (cap->r.rCurrentNursery->link == NULL || - cap->r.rNursery->n_large_blocks >= alloc_blocks_lim); + g0->n_large_blocks >= alloc_blocks_lim); } /* for splitting blocks groups in two */ @@ -121,7 +121,7 @@ void dirty_MVAR(StgRegTable *reg, StgClosure *p); Nursery manipulation -------------------------------------------------------------------------- */ -extern step *nurseries; +extern nursery *nurseries; void resetNurseries ( void ); void resizeNurseries ( nat blocks ); |