summaryrefslogtreecommitdiff
path: root/rts/sm/Storage.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2008-09-12 10:01:40 +0000
committerSimon Marlow <marlowsd@gmail.com>2008-09-12 10:01:40 +0000
commitfdd7a41eec615cf3d77a95896a6183326e60c2ca (patch)
tree6e1a8dfa38fec07853a1a628946a6f95e239738a /rts/sm/Storage.c
parent561ca008ff2485af1446303217d6e7ab1148d50a (diff)
downloadhaskell-fdd7a41eec615cf3d77a95896a6183326e60c2ca.tar.gz
Fix some bugs in the stack-reducing code (#2571)
Diffstat (limited to 'rts/sm/Storage.c')
-rw-r--r--rts/sm/Storage.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index 8d237c15f3..e10304c5a1 100644
--- a/rts/sm/Storage.c
+++ b/rts/sm/Storage.c
@@ -661,8 +661,8 @@ allocatedBytes( void )
return allocated;
}
-// split N blocks off the start of the given bdescr, returning the
-// remainder as a new block group. We treat the remainder as if it
+// split N blocks off the front of the given bdescr, returning the
+// new block group. We treat the remainder as if it
// had been freshly allocated in generation 0.
bdescr *
splitLargeBlock (bdescr *bd, nat blocks)
@@ -680,6 +680,7 @@ splitLargeBlock (bdescr *bd, nat blocks)
new_bd->step = g0s0;
new_bd->flags = BF_LARGE;
new_bd->free = bd->free;
+ ASSERT(new_bd->free <= new_bd->start + new_bd->blocks * BLOCK_SIZE_W);
// add the new number of blocks to the counter. Due to the gaps
// for block descriptor, new_bd->blocks + bd->blocks might not be
@@ -687,7 +688,7 @@ splitLargeBlock (bdescr *bd, nat blocks)
bd->step->n_large_blocks += bd->blocks;
return new_bd;
-}
+}
/* -----------------------------------------------------------------------------
allocateLocal()