[project @ 2001-08-09 12:46:06 by sewardj]
[ghc-hetmet.git] / ghc / rts / Storage.c
index 0c5a815..feff59c 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Storage.c,v 1.44 2001/08/08 10:50:37 simonmar Exp $
+ * $Id: Storage.c,v 1.48 2001/08/09 12:46:06 sewardj Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -59,7 +59,7 @@ static void *stgReallocForGMP (void *ptr, size_t old_size, size_t new_size);
 static void  stgDeallocForGMP (void *ptr, size_t size);
 
 void
-initStorage (void)
+initStorage( void )
 {
   nat g, s;
   step *stp;
@@ -82,7 +82,8 @@ initStorage (void)
   }
 #endif
 
-  if (RtsFlags.GcFlags.heapSizeSuggestion > 
+  if (RtsFlags.GcFlags.maxHeapSize != 0 &&
+      RtsFlags.GcFlags.heapSizeSuggestion > 
       RtsFlags.GcFlags.maxHeapSize) {
     RtsFlags.GcFlags.maxHeapSize = RtsFlags.GcFlags.heapSizeSuggestion;
   }
@@ -147,9 +148,12 @@ initStorage (void)
       stp->scan = NULL;
       stp->scan_bd = NULL;
       stp->large_objects = NULL;
+      stp->n_large_blocks = 0;
       stp->new_large_objects = NULL;
       stp->scavenged_large_objects = NULL;
+      stp->n_scavenged_large_blocks = 0;
       stp->is_compacted = 0;
+      stp->bitmap = NULL;
     }
   }
   
@@ -161,7 +165,10 @@ initStorage (void)
     generations[g].steps[s].to = &generations[g+1].steps[0];
   }
   
-  /* The oldest generation has one step. */
+  /* The oldest generation has one step and it is compacted. */
+  if (RtsFlags.GcFlags.compact) {
+      oldest_gen->steps[0].is_compacted = 1;
+  }
   oldest_gen->steps[0].to = &oldest_gen->steps[0];
 
   /* generation 0 is special: that's the nursery */