[commit: ghc] master: simplify processNurseryForDead (5b0b83b)

git at git.haskell.org git at git.haskell.org
Thu Nov 14 12:07:49 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5b0b83becfb14d1eeffd38887ad66ee81a1c48b5/ghc

>---------------------------------------------------------------

commit 5b0b83becfb14d1eeffd38887ad66ee81a1c48b5
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Wed Nov 13 14:48:51 2013 +0000

    simplify processNurseryForDead
    
    It wasn't actually broken, but it wasn't obviously right either.


>---------------------------------------------------------------

5b0b83becfb14d1eeffd38887ad66ee81a1c48b5
 rts/LdvProfile.c |   21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/rts/LdvProfile.c b/rts/LdvProfile.c
index d22c0d8..d077f3c 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);
+        }
     }
 }
 



More information about the ghc-commits mailing list