Commit f25dc05e authored by Simon Marlow's avatar Simon Marlow
Browse files

Fix for a bug in setNumCapabilities

parent 011d6f96
......@@ -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,7 +469,6 @@ 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.rCurrentAlloc = NULL;
}
......
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