X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FStorage.c;h=ec0728af70c6779a5b00cf6adc7424b8b026eb43;hb=ed974e41e3dd1acd24e2ef816b104ff66ea720ee;hp=0bf3e21555630892de56526c2bdf7f207ee15e2d;hpb=f6692611aad945e46ffb615bde1df7def3fc742f;p=ghc-hetmet.git diff --git a/ghc/rts/Storage.c b/ghc/rts/Storage.c index 0bf3e21..ec0728a 100644 --- a/ghc/rts/Storage.c +++ b/ghc/rts/Storage.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Storage.c,v 1.20 1999/11/02 15:06:04 simonmar Exp $ + * $Id: Storage.c,v 1.21 1999/11/09 15:46:59 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -236,13 +236,20 @@ allocNurseries( void ) #ifdef SMP { Capability *cap; - + bdescr *bd; + g0s0->blocks = NULL; g0s0->n_blocks = 0; for (cap = free_capabilities; cap != NULL; cap = cap->link) { cap->rNursery = allocNursery(NULL, RtsFlags.GcFlags.minAllocAreaSize); cap->rCurrentNursery = cap->rNursery; + for (bd = cap->rNursery; bd != NULL; bd = bd->link) { + bd->back = (bdescr *)cap; + } } + /* Set the back links to be equal to the Capability, + * so we can do slightly better informed locking. + */ } #else /* SMP */ nursery_blocks = RtsFlags.GcFlags.minAllocAreaSize; @@ -480,8 +487,11 @@ calcAllocated( void ) #ifdef SMP Capability *cap; - /* All tasks must be stopped */ - ASSERT(n_free_capabilities == RtsFlags.ConcFlags.nNodes); + /* All tasks must be stopped. Can't assert that all the + capabilities are owned by the scheduler, though: one or more + tasks might have been stopped while they were running (non-main) + threads. */ + /* ASSERT(n_free_capabilities == RtsFlags.ConcFlags.nNodes); */ allocated = n_free_capabilities * RtsFlags.GcFlags.minAllocAreaSize * BLOCK_SIZE_W