summaryrefslogtreecommitdiff
path: root/ghc/rts/BlockAlloc.c
diff options
context:
space:
mode:
authorsimonmar <unknown>2001-07-23 17:23:20 +0000
committersimonmar <unknown>2001-07-23 17:23:20 +0000
commitdfd7d6d02a597949b08161ae3d49dc6dfc9e812d (patch)
tree4afa5a75fa30ebbe08247543c3863a49ed54a792 /ghc/rts/BlockAlloc.c
parent9528fa3e6229f36e424c5e327255694066017e10 (diff)
downloadhaskell-dfd7d6d02a597949b08161ae3d49dc6dfc9e812d.tar.gz
[project @ 2001-07-23 17:23:19 by simonmar]
Add a compacting garbage collector. It isn't enabled by default, as there are still a couple of problems: there's a fallback case I haven't implemented yet which means it will occasionally bomb out, and speed-wise it's quite a bit slower than the copying collector (about 1.8x slower). Until I can make it go faster, it'll only be useful when you're actually running low on real memory. '+RTS -c' to enable it. Oh, and I cleaned up a few things in the RTS while I was there, and fixed one or two possibly real bugs in the existing GC.
Diffstat (limited to 'ghc/rts/BlockAlloc.c')
-rw-r--r--ghc/rts/BlockAlloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ghc/rts/BlockAlloc.c b/ghc/rts/BlockAlloc.c
index e6a176b658..6186671059 100644
--- a/ghc/rts/BlockAlloc.c
+++ b/ghc/rts/BlockAlloc.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: BlockAlloc.c,v 1.8 2001/07/23 10:47:16 simonmar Exp $
+ * $Id: BlockAlloc.c,v 1.9 2001/07/23 17:23:19 simonmar Exp $
*
* (c) The GHC Team 1998-2000
*
@@ -63,6 +63,8 @@ allocGroup(nat n)
void *mblock;
bdescr *bd, **last;
+ ASSERT(n != 0);
+
if (n > BLOCKS_PER_MBLOCK) {
return allocMegaGroup(BLOCKS_TO_MBLOCKS(n));
}