From: simonmar Date: Wed, 11 May 2005 12:45:55 +0000 (+0000) Subject: [project @ 2005-05-11 12:45:55 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~573 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=77e02de55d2e8a1b774b8dfc90d47ad203252178;p=ghc-hetmet.git [project @ 2005-05-11 12:45:55 by simonmar] allocating a large block: bump the block count on the nursery step, rather than the global alloc_blocks counter. Also, change the heap-full check to be "nursery full" rather than alloc_blocks>=alloc_blocks_lim. --- diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 7075b20..4edc6ab 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -1475,12 +1475,13 @@ scheduleHandleHeapOverflow( Capability *cap, StgTSO *t ) debugBelch("--<< thread %ld (%s) stopped: requesting a large block (size %ld)\n", (long)t->id, whatNext_strs[t->what_next], blocks)); - // don't do this if it would push us over the - // alloc_blocks_lim limit; we'll GC first. - if (alloc_blocks + blocks < alloc_blocks_lim) { + // don't do this if the nursery is (nearly) full, we'll GC first. + if (cap->r.rCurrentNursery->link != NULL || + cap->r.rNursery->n_blocks == 1) { // paranoia to prevent infinite loop + // if the nursery has only one block. - alloc_blocks += blocks; bd = allocGroup( blocks ); + cap->r.rNursery->n_blocks += blocks; // link the new group into the list bd->link = cap->r.rCurrentNursery; @@ -1491,7 +1492,6 @@ scheduleHandleHeapOverflow( Capability *cap, StgTSO *t ) #if !defined(SMP) ASSERT(g0s0->blocks == cap->r.rCurrentNursery && g0s0 == cap->r.rNursery); - g0s0->blocks = bd; #endif cap->r.rNursery->blocks = bd; }