#include "Storage.h"
#include "Schedule.h"
#include "RetainerProfile.h" // for counting memory blocks (memInventory)
-#include "StoragePriv.h"
#include <stdlib.h>
#include <string.h>
errorBelch("-G1 is incompatible with SMP");
stg_exit(1);
}
- // No -H, for now
- if (RtsFlags.GcFlags.heapSizeSuggestion > 0) {
- errorBelch("-H<size> is incompatible with SMP");
- stg_exit(1);
- }
#endif
/* generation 0 is special: that's the nursery */
// Resize each of the nurseries to the specified size.
//
void
-resizeNurseries (nat blocks)
+resizeNurseriesFixed (nat blocks)
{
nat i;
for (i = 0; i < n_nurseries; i++) {
}
}
+//
+// Resize the nurseries to the total specified size.
+//
+void
+resizeNurseries (nat blocks)
+{
+ // If there are multiple nurseries, then we just divide the number
+ // of available blocks between them.
+ resizeNurseriesFixed(blocks / n_nurseries);
+}
+
/* -----------------------------------------------------------------------------
The allocate() interface
#ifdef SMP
for (i = 0; i < n_nurseries; i++) {
Capability *cap;
- for ( bd = capabilities[i].r.rCurrentNursery;
+ for ( bd = capabilities[i].r.rCurrentNursery->link;
bd != NULL; bd = bd->link ) {
allocated -= BLOCK_SIZE_W;
}
}
for (s = 0; s < n_nurseries; s++) {
- ASSERT(countBlocks(generations[g].steps[s].blocks)
- == generations[g].steps[s].n_blocks);
- ASSERT(countBlocks(generations[g].steps[s].large_objects)
- == generations[g].steps[s].n_large_blocks);
+ ASSERT(countBlocks(nurseries[s].blocks)
+ == nurseries[s].n_blocks);
+ ASSERT(countBlocks(nurseries[s].large_objects)
+ == nurseries[s].n_large_blocks);
}
checkFreeListSanity();