X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FStorage.c;h=2172f9bdb01d4e43f7a0e65db32e3e531125419b;hb=3785918d9bdbd4e611ffc6da198c36b5797b8c77;hp=2e43bffdfc5ab6b39325664d99ca8e8acf1a3718;hpb=cebecc110be6e53c310326940a311cab7fad84ca;p=ghc-hetmet.git diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index 2e43bff..2172f9b 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -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) {