When using -H<size> in SMP mode, divide the total nursery size amongst
the various nurseries. -H<size> now does something reasonable with
SMP.
Nursery manipulation
-------------------------------------------------------------------------- */
Nursery manipulation
-------------------------------------------------------------------------- */
-extern void allocNurseries ( void );
-extern void resetNurseries ( void );
-extern void resizeNurseries ( nat blocks );
-extern void tidyAllocateLists ( void );
-extern lnat countNurseryBlocks ( void );
+extern void allocNurseries ( void );
+extern void resetNurseries ( void );
+extern void resizeNurseries ( nat blocks );
+extern void resizeNurseriesFixed ( nat blocks );
+extern void tidyAllocateLists ( void );
+extern lnat countNurseryBlocks ( void );
/* -----------------------------------------------------------------------------
Functions from GC.c
/* -----------------------------------------------------------------------------
Functions from GC.c
} else {
// we might have added extra large blocks to the nursery, so
// resize back to minAllocAreaSize again.
} else {
// we might have added extra large blocks to the nursery, so
// resize back to minAllocAreaSize again.
- resizeNurseries(RtsFlags.GcFlags.minAllocAreaSize);
+ resizeNurseriesFixed(RtsFlags.GcFlags.minAllocAreaSize);
errorBelch("-G1 is incompatible with SMP");
stg_exit(1);
}
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 */
#endif
/* generation 0 is special: that's the nursery */
// Resize each of the nurseries to the specified size.
//
void
// 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++) {
{
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
/* -----------------------------------------------------------------------------
The allocate() interface