}
void
-freeStorage (void)
+freeStorage (rtsBool free_heap)
{
stgFree(generations);
- freeAllMBlocks();
+ if (free_heap) freeAllMBlocks();
#if defined(THREADED_RTS)
closeMutex(&sm_mutex);
#endif
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
if (i > 0) {
bd[i].u.back = &bd[i-1];
+ } else {
+ bd[i].u.back = NULL;
}
if (i+1 < n) {