Commit b502893a authored by sof's avatar sof
Browse files

[project @ 2002-01-24 01:45:55 by sof]

SMP: bunch of triv. changes to account for the fact that a Capability is no longer just a RegTable
parent 533633e4
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: Storage.c,v 1.57 2001/11/28 14:47:54 simonmar Exp $ * $Id: Storage.c,v 1.58 2002/01/24 01:45:55 sof Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -293,9 +293,9 @@ allocNurseries( void ) ...@@ -293,9 +293,9 @@ allocNurseries( void )
g0s0->blocks = NULL; g0s0->blocks = NULL;
g0s0->n_blocks = 0; g0s0->n_blocks = 0;
for (cap = free_capabilities; cap != NULL; cap = cap->link) { for (cap = free_capabilities; cap != NULL; cap = cap->link) {
cap->rNursery = allocNursery(NULL, RtsFlags.GcFlags.minAllocAreaSize); cap->r.rNursery = allocNursery(NULL, RtsFlags.GcFlags.minAllocAreaSize);
cap->rCurrentNursery = cap->rNursery; cap->r.rCurrentNursery = cap->r.rNursery;
for (bd = cap->rNursery; bd != NULL; bd = bd->link) { for (bd = cap->r.rNursery; bd != NULL; bd = bd->link) {
bd->u.back = (bdescr *)cap; bd->u.back = (bdescr *)cap;
} }
} }
...@@ -325,13 +325,13 @@ resetNurseries( void ) ...@@ -325,13 +325,13 @@ resetNurseries( void )
ASSERT(n_free_capabilities == RtsFlags.ParFlags.nNodes); ASSERT(n_free_capabilities == RtsFlags.ParFlags.nNodes);
for (cap = free_capabilities; cap != NULL; cap = cap->link) { for (cap = free_capabilities; cap != NULL; cap = cap->link) {
for (bd = cap->rNursery; bd; bd = bd->link) { for (bd = cap->r.rNursery; bd; bd = bd->link) {
bd->free = bd->start; bd->free = bd->start;
ASSERT(bd->gen_no == 0); ASSERT(bd->gen_no == 0);
ASSERT(bd->step == g0s0); ASSERT(bd->step == g0s0);
IF_DEBUG(sanity,memset(bd->start, 0xaa, BLOCK_SIZE)); IF_DEBUG(sanity,memset(bd->start, 0xaa, BLOCK_SIZE));
} }
cap->rCurrentNursery = cap->rNursery; cap->r.rCurrentNursery = cap->r.rNursery;
} }
#else #else
for (bd = g0s0->blocks; bd; bd = bd->link) { for (bd = g0s0->blocks; bd; bd = bd->link) {
...@@ -635,13 +635,13 @@ calcAllocated( void ) ...@@ -635,13 +635,13 @@ calcAllocated( void )
+ allocated_bytes(); + allocated_bytes();
for (cap = free_capabilities; cap != NULL; cap = cap->link) { for (cap = free_capabilities; cap != NULL; cap = cap->link) {
for ( bd = cap->rCurrentNursery->link; bd != NULL; bd = bd->link ) { for ( bd = cap->r.rCurrentNursery->link; bd != NULL; bd = bd->link ) {
allocated -= BLOCK_SIZE_W; allocated -= BLOCK_SIZE_W;
} }
if (cap->rCurrentNursery->free < cap->rCurrentNursery->start if (cap->r.rCurrentNursery->free < cap->r.rCurrentNursery->start
+ BLOCK_SIZE_W) { + BLOCK_SIZE_W) {
allocated -= (cap->rCurrentNursery->start + BLOCK_SIZE_W) allocated -= (cap->r.rCurrentNursery->start + BLOCK_SIZE_W)
- cap->rCurrentNursery->free; - cap->r.rCurrentNursery->free;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment