[commit: ghc] master: When using -H with -M<size>, don't exceed the maximum heap size (4d208ae)

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.