summaryrefslogtreecommitdiff
path: root/ghc/rts/BlockAlloc.c
diff options
context:
space:
mode:
authorpanne <unknown>1999-07-01 13:48:22 +0000
committerpanne <unknown>1999-07-01 13:48:22 +0000
commit663f22e676aefe4562fc4d75cf055ad64536f440 (patch)
tree17ff7a87cf6a324dbcf9f890ca8f46f861f1d6d5 /ghc/rts/BlockAlloc.c
parenteea46a8ce8c8d0f80608e627ae05d7de76baf967 (diff)
downloadhaskell-663f22e676aefe4562fc4d75cf055ad64536f440.tar.gz
[project @ 1999-07-01 13:48:22 by panne]
The allocator for mega groups now checks if consecutive megablocks on the free list are contiguous in memory. The omission of this check caused all kinds of funny runtime errors and took away at least five happy years of my life... :-{
Diffstat (limited to 'ghc/rts/BlockAlloc.c')
-rw-r--r--ghc/rts/BlockAlloc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ghc/rts/BlockAlloc.c b/ghc/rts/BlockAlloc.c
index 166ef3aea6..652b629bfd 100644
--- a/ghc/rts/BlockAlloc.c
+++ b/ghc/rts/BlockAlloc.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: BlockAlloc.c,v 1.5 1999/03/26 14:54:43 simonm Exp $
+ * $Id: BlockAlloc.c,v 1.6 1999/07/01 13:48:22 panne Exp $
*
* (c) The GHC Team 1998-1999
*
@@ -128,7 +128,9 @@ allocMegaGroup(nat n)
if (bd->blocks == BLOCKS_PER_MBLOCK) { /* whole megablock found */
- if (grp_start == NULL) { /* is it the first one we've found? */
+ /* is it the first one we've found or a non-contiguous megablock? */
+ if (grp_start == NULL ||
+ bd->start != last->start + MBLOCK_SIZE/sizeof(W_)) {
grp_start = bd;
grp_prev = last;
mbs_found = 1;