Fix maintenance of n_blocks in the RTS
authorIan Lynagh <igloo@earth.li>
Mon, 30 Apr 2012 23:25:55 +0000 (00:25 +0100)
committerIan Lynagh <igloo@earth.li>
Mon, 30 Apr 2012 23:25:55 +0000 (00:25 +0100)
It was causing assertion failures of
    ASSERT(countBlocks(nursery->blocks) == nursery->n_blocks)
at
    ghc-stage2: internal error: ASSERTION FAILED: file rts/sm/Sanity.c, line 878

rts/sm/Storage.c

index 7da0c70..17798a2 100644 (file)
@@ -796,7 +796,7 @@ allocatePinned (Capability *cap, lnat n)
             if (bd->link != NULL) {
                 bd->link->u.back = cap->r.rCurrentNursery;
             }
-            cap->r.rNursery->n_blocks--;
+            cap->r.rNursery->n_blocks -= bd->blocks;
         }
 
         cap->pinned_object_block = bd;