diff options
author | Simon Marlow <marlowsd@gmail.com> | 2013-11-13 14:48:51 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2013-11-14 12:07:33 +0000 |
commit | 5b0b83becfb14d1eeffd38887ad66ee81a1c48b5 (patch) | |
tree | 1f23c9cd3a1e9e391d422841568815eaf12bc788 /rts | |
parent | 35c05d71cb84c25983ab19b1010ac93ab040b266 (diff) | |
download | haskell-5b0b83becfb14d1eeffd38887ad66ee81a1c48b5.tar.gz |
simplify processNurseryForDead
It wasn't actually broken, but it wasn't obviously right either.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/LdvProfile.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/rts/LdvProfile.c b/rts/LdvProfile.c index d22c0d8f20..d077f3caf7 100644 --- a/rts/LdvProfile.c +++ b/rts/LdvProfile.c @@ -172,21 +172,16 @@ processHeapForDead( bdescr *bd ) static void processNurseryForDead( void ) { - StgPtr p, bdLimit; + StgPtr p; bdescr *bd; - bd = MainCapability.r.rNursery->blocks; - while (bd->start < bd->free) { - p = bd->start; - bdLimit = bd->start + BLOCK_SIZE_W; - while (p < bd->free && p < bdLimit) { - p += processHeapClosureForDead((StgClosure *)p); - while (p < bd->free && p < bdLimit && !*p) // skip slop - p++; - } - bd = bd->link; - if (bd == NULL) - break; + for (bd = MainCapability.r.rNursery->blocks; bd != NULL; bd = bd->link) { + p = bd->start; + while (p < bd->free) { + while (p < bd->free && !*p) p++; // skip slop + if (p >= bd->free) break; + p += processHeapClosureForDead((StgClosure *)p); + } } } |