[project @ 1999-05-28 08:07:52 by simonpj]
[ghc-hetmet.git] / ghc / rts / BlockAlloc.c
index 26f2a60..166ef3a 100644 (file)
@@ -1,6 +1,8 @@
 /* -----------------------------------------------------------------------------
- * $Id: BlockAlloc.c,v 1.3 1999/01/13 17:25:37 simonm Exp $
+ * $Id: BlockAlloc.c,v 1.5 1999/03/26 14:54:43 simonm Exp $
  *
+ * (c) The GHC Team 1998-1999
+ * 
  * The block allocator and free list manager.
  *
  * This is the architecture independent part of the block allocator.
@@ -86,8 +88,10 @@ allocGroup(nat n)
   initMBlock(mblock);          /* initialise the start fields */
   bd = FIRST_BDESCR(mblock);
   initGroup(n,bd);             /* we know the group will fit */
-  initGroup(BLOCKS_PER_MBLOCK-n, bd+n);
-  freeGroup(bd+n);             /* add the rest on to the free list */
+  if (n < BLOCKS_PER_MBLOCK) {
+    initGroup(BLOCKS_PER_MBLOCK-n, bd+n);
+    freeGroup(bd+n);           /* add the rest on to the free list */
+  }
   return bd;
 }