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 /includes/stg | |
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 'includes/stg')
-rw-r--r-- | includes/stg/Regs.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/stg/Regs.h b/includes/stg/Regs.h index d620bf1466..e50b431d14 100644 --- a/includes/stg/Regs.h +++ b/includes/stg/Regs.h @@ -80,10 +80,10 @@ typedef struct StgRegTable_ { StgPtr rSpLim; StgPtr rHp; StgPtr rHpLim; - struct StgTSO_ *rCurrentTSO; - struct step_ *rNursery; - struct bdescr_ *rCurrentNursery; /* Hp/HpLim point into this block */ - struct bdescr_ *rCurrentAlloc; /* for allocation using allocate() */ + struct StgTSO_ * rCurrentTSO; + struct nursery_ * rNursery; + struct bdescr_ * rCurrentNursery; /* Hp/HpLim point into this block */ + struct bdescr_ * rCurrentAlloc; /* for allocation using allocate() */ StgWord rHpAlloc; /* number of *bytes* being allocated in heap */ StgWord rRet; // holds the return code of the thread } StgRegTable; |