Massive patch for the first months work adding System FC to GHC #35
[ghc-hetmet.git] / rts / Storage.c
index d3b0597..0c9c60e 100644 (file)
@@ -127,7 +127,7 @@ initStorage( void )
       RtsFlags.GcFlags.minAllocAreaSize > 
       RtsFlags.GcFlags.maxHeapSize) {
       errorBelch("maximum heap size (-M) is smaller than minimum alloc area size (-A)");
-      exit(1);
+      RtsFlags.GcFlags.minAllocAreaSize = RtsFlags.GcFlags.maxHeapSize;
   }
 
   initBlockAllocator();
@@ -279,6 +279,10 @@ freeStorage (void)
       stgFree(generations[g].steps);
     stgFree(generations);
     freeAllMBlocks();
+#if defined(THREADED_RTS)
+    closeMutex(&sm_mutex);
+    closeMutex(&atomic_modify_mutvar_mutex);
+#endif
 }
 
 /* -----------------------------------------------------------------------------