[project @ 2005-04-28 15:44:16 by simonmar]
[ghc-hetmet.git] / ghc / rts / Storage.c
index 536d8b7..f466a58 100644 (file)
@@ -216,11 +216,6 @@ initStorage( void )
       errorBelch("-G1 is incompatible with SMP");
       stg_exit(1);
   }
-  // No -H, for now
-  if (RtsFlags.GcFlags.heapSizeSuggestion > 0) {
-      errorBelch("-H<size> is incompatible with SMP");
-      stg_exit(1);
-  }
 #endif
 
   /* generation 0 is special: that's the nursery */
@@ -509,7 +504,7 @@ resizeNursery ( step *stp, nat blocks )
 // Resize each of the nurseries to the specified size.
 //
 void
-resizeNurseries (nat blocks)
+resizeNurseriesFixed (nat blocks)
 {
     nat i;
     for (i = 0; i < n_nurseries; i++) {
@@ -517,6 +512,17 @@ resizeNurseries (nat blocks)
     }
 }
 
+// 
+// Resize the nurseries to the total specified size.
+//
+void
+resizeNurseries (nat blocks)
+{
+    // If there are multiple nurseries, then we just divide the number
+    // of available blocks between them.
+    resizeNurseriesFixed(blocks / n_nurseries);
+}
+
 /* -----------------------------------------------------------------------------
    The allocate() interface
 
@@ -741,7 +747,7 @@ calcAllocated( void )
 #ifdef SMP
   for (i = 0; i < n_nurseries; i++) {
       Capability *cap;
-      for ( bd = capabilities[i].r.rCurrentNursery; 
+      for ( bd = capabilities[i].r.rCurrentNursery->link; 
            bd != NULL; bd = bd->link ) {
          allocated -= BLOCK_SIZE_W;
       }