summaryrefslogtreecommitdiff
path: root/rts/sm
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-12-13 13:03:44 +0000
committerSimon Marlow <marlowsd@gmail.com>2011-12-13 15:02:12 +0000
commitf25dc05ef44b6b653a1b8974289804971214dbff (patch)
tree7e49c02a9afde336775d7be25e6a38665f5e756b /rts/sm
parent011d6f96b6bbaf1aa651c96ccbee0d21d16c2146 (diff)
downloadhaskell-f25dc05ef44b6b653a1b8974289804971214dbff.tar.gz
Fix for a bug in setNumCapabilities
Diffstat (limited to 'rts/sm')
-rw-r--r--rts/sm/Storage.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index dc887c3147..012ba514db 100644
--- a/rts/sm/Storage.c
+++ b/rts/sm/Storage.c
@@ -190,7 +190,7 @@ initStorage( void )
void storageAddCapabilities (nat from, nat to)
{
- nat n, g;
+ nat n, g, i;
if (from > 0) {
nurseries = stgReallocBytes(nurseries, to * sizeof(struct nursery_),
@@ -200,6 +200,12 @@ void storageAddCapabilities (nat from, nat to)
"storageAddCapabilities");
}
+ // we've moved the nurseries, so we have to update the rNursery
+ // pointers from the Capabilities.
+ for (i = 0; i < to; i++) {
+ capabilities[i].r.rNursery = &nurseries[i];
+ }
+
/* The allocation area. Policy: keep the allocation area
* small to begin with, even if we have a large suggested heap
* size. Reason: we're going to do a major collection first, and we
@@ -463,8 +469,7 @@ assignNurseriesToCapabilities (nat from, nat to)
nat i;
for (i = from; i < to; i++) {
- capabilities[i].r.rNursery = &nurseries[i];
- capabilities[i].r.rCurrentNursery = nurseries[i].blocks;
+ capabilities[i].r.rCurrentNursery = nurseries[i].blocks;
capabilities[i].r.rCurrentAlloc = NULL;
}
}