[project @ 2001-10-26 11:33:13 by sewardj]
[ghc-hetmet.git] / ghc / rts / BlockAlloc.c
index 6819463..65205f8 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: BlockAlloc.c,v 1.7 2000/01/30 10:17:44 simonmar Exp $
+ * $Id: BlockAlloc.c,v 1.10 2001/08/14 13:40:09 sewardj Exp $
  *
  * (c) The GHC Team 1998-2000
  * 
@@ -16,6 +16,7 @@
  *
  * ---------------------------------------------------------------------------*/
 
+#include "PosixSource.h"
 #include "Rts.h"
 #include "RtsFlags.h"
 #include "RtsUtils.h"
@@ -63,6 +64,8 @@ allocGroup(nat n)
   void *mblock;
   bdescr *bd, **last;
 
+  ASSERT(n != 0);
+
   if (n > BLOCKS_PER_MBLOCK) {
     return allocMegaGroup(BLOCKS_TO_MBLOCKS(n));
   }
@@ -222,7 +225,7 @@ freeGroup(bdescr *p)
 #ifdef DEBUG
   p->free = (void *)-1;  /* indicates that this block is free */
   p->step = NULL;
-  p->gen  = NULL;
+  p->gen_no = 0;
   /* fill the block group with garbage if sanity checking is on */
   IF_DEBUG(sanity,memset(p->start, 0xaa, p->blocks * BLOCK_SIZE));
 #endif