Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/4d208aed2f433cd2f46a7df016bad50af2e07e40

>---------------------------------------------------------------

commit 4d208aed2f433cd2f46a7df016bad50af2e07e40
Author: Simon Marlow <[email protected]>
Date:   Fri Sep 7 13:35:16 2012 +0100

    When using -H with -M<size>, don't exceed the maximum heap size

>---------------------------------------------------------------

 rts/sm/GC.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 1b81b26..53c35c9 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -1528,7 +1528,11 @@ resize_generations (void)
                       RtsFlags.GcFlags.minOldGenSize);
        
         if (RtsFlags.GcFlags.heapSizeSuggestionAuto) {
-            RtsFlags.GcFlags.heapSizeSuggestion = size;
+            if (max > 0) {
+                RtsFlags.GcFlags.heapSizeSuggestion = stg_min(max, size);
+            } else {
+                RtsFlags.GcFlags.heapSizeSuggestion = size;
+            }
         }
 
        // minimum size for generation zero



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to