[project @ 2001-10-18 14:41:01 by simonmar]
[ghc-hetmet.git] / ghc / rts / Storage.c
index 8cba094..6b4333d 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Storage.c,v 1.50 2001/08/30 10:21:40 simonmar Exp $
+ * $Id: Storage.c,v 1.52 2001/10/18 14:41:01 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -17,6 +17,7 @@
 #include "MBlock.h"
 #include "Weak.h"
 #include "Sanity.h"
+#include "Arena.h"
 
 #include "Storage.h"
 #include "Schedule.h"
@@ -89,6 +90,13 @@ initStorage( void )
     RtsFlags.GcFlags.maxHeapSize = RtsFlags.GcFlags.heapSizeSuggestion;
   }
 
+  if (RtsFlags.GcFlags.maxHeapSize != 0 &&
+      RtsFlags.GcFlags.minAllocAreaSize > 
+      RtsFlags.GcFlags.maxHeapSize) {
+      prog_belch("maximum heap size (-M) is smaller than minimum alloc area size (-A)");
+      exit(1);
+  }
+
   initBlockAllocator();
   
   /* allocate generation info array */
@@ -766,6 +774,9 @@ memInventory(void)
     total_blocks += bd->blocks;
   }
   
+  // count the blocks allocated by the arena allocator
+  total_blocks += arenaBlocks();
+
   /* count the blocks on the free list */
   free_blocks = countFreeList();