X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FStorage.c;h=36741a60ba829cca14f182079dc0a521937a6fdd;hb=f48b8ba55be1f05a0a8e0cc3348ba44ca86c554c;hp=6c45cbed594a94c702af06d44d3fec4a57b0990f;hpb=ebfa6fde6d9797ad2434a2af73a4c85b2984e00a;p=ghc-hetmet.git diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index 6c45cbe..36741a6 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -272,10 +272,13 @@ initStorage( void ) #ifdef THREADED_RTS initSpinLock(&gc_alloc_block_sync); - initSpinLock(&recordMutableGen_sync); whitehole_spin = 0; #endif + N = 0; + + initGcThreads(); + IF_DEBUG(gc, statDescribeGens()); RELEASE_SM_LOCK; @@ -372,7 +375,7 @@ newCAF(StgClosure* caf) * any more and can use it as a STATIC_LINK. */ ((StgIndStatic *)caf)->saved_info = NULL; - recordMutableGen(caf, oldest_gen); + recordMutableGen(caf, oldest_gen->no); } RELEASE_SM_LOCK; @@ -613,6 +616,13 @@ allocateInGen (generation *g, lnat n) if (RtsFlags.GcFlags.maxHeapSize > 0 && req_blocks >= RtsFlags.GcFlags.maxHeapSize) { heapOverflow(); + // heapOverflow() doesn't exit (see #2592), but we aren't + // in a position to do a clean shutdown here: we + // either have to allocate the memory or exit now. + // Allocating the memory would be bad, because the user + // has requested that we not exceed maxHeapSize, so we + // just exit. + stg_exit(EXIT_HEAPOVERFLOW); } bd = allocGroup(req_blocks); @@ -1473,9 +1483,6 @@ checkSanity( void ) == generations[g].steps[s].n_large_blocks); checkHeap(generations[g].steps[s].blocks); checkChain(generations[g].steps[s].large_objects); - if (g > 0) { - checkMutableList(generations[g].mut_list, g); - } } } @@ -1492,9 +1499,9 @@ checkSanity( void ) #if defined(THREADED_RTS) // check the stacks too in threaded mode, because we don't do a // full heap sanity check in this case (see checkHeap()) - checkGlobalTSOList(rtsTrue); + checkMutableLists(rtsTrue); #else - checkGlobalTSOList(rtsFalse); + checkMutableLists(rtsFalse); #endif }