From: simonmar Date: Wed, 27 Apr 2005 14:37:26 +0000 (+0000) Subject: [project @ 2005-04-27 14:37:26 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~653 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e0b21a6c8434d1815db5ae0d336de590a04b31fc;p=ghc-hetmet.git [project @ 2005-04-27 14:37:26 by simonmar] When using -H in SMP mode, divide the total nursery size amongst the various nurseries. -H now does something reasonable with SMP. --- diff --git a/ghc/includes/Storage.h b/ghc/includes/Storage.h index 69ddef6..a8a6d24 100644 --- a/ghc/includes/Storage.h +++ b/ghc/includes/Storage.h @@ -369,11 +369,12 @@ INLINE_HEADER StgWord stack_frame_sizeW( StgClosure *frame ) 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 diff --git a/ghc/rts/GC.c b/ghc/rts/GC.c index e77cbf5..2666f6b 100644 --- a/ghc/rts/GC.c +++ b/ghc/rts/GC.c @@ -1029,7 +1029,7 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc ) } 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); } } diff --git a/ghc/rts/Storage.c b/ghc/rts/Storage.c index 536d8b7..84232e7 100644 --- a/ghc/rts/Storage.c +++ b/ghc/rts/Storage.c @@ -216,11 +216,6 @@ initStorage( void ) errorBelch("-G1 is incompatible with SMP"); stg_exit(1); } - // No -H, for now - if (RtsFlags.GcFlags.heapSizeSuggestion > 0) { - errorBelch("-H is incompatible with SMP"); - stg_exit(1); - } #endif /* generation 0 is special: that's the nursery */ @@ -509,7 +504,7 @@ resizeNursery ( step *stp, nat blocks ) // 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++) { @@ -517,6 +512,17 @@ resizeNurseries (nat blocks) } } +// +// 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