Allow "INLINEABLE" as a synonym
[ghc-hetmet.git] / rts / sm / Storage.c
index 2e43bff..2172f9b 100644 (file)
@@ -213,10 +213,10 @@ exitStorage (void)
 }
 
 void
-freeStorage (void)
+freeStorage (rtsBool free_heap)
 {
     stgFree(generations);
-    freeAllMBlocks();
+    if (free_heap) freeAllMBlocks();
 #if defined(THREADED_RTS)
     closeMutex(&sm_mutex);
 #endif
@@ -331,7 +331,7 @@ newDynCAF (StgRegTable *reg STG_UNUSED, StgClosure *caf)
 static bdescr *
 allocNursery (bdescr *tail, nat blocks)
 {
-    bdescr *bd;
+    bdescr *bd = NULL;
     nat i, n;
 
     // We allocate the nursery as a single contiguous block and then
@@ -353,6 +353,8 @@ allocNursery (bdescr *tail, nat blocks)
 
             if (i > 0) {
                 bd[i].u.back = &bd[i-1];
+            } else {
+                bd[i].u.back = NULL;
             }
 
             if (i+1 < n) {