summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-09-07 13:35:16 +0100
committerSimon Marlow <marlowsd@gmail.com>2012-09-07 14:22:34 +0100
commit4d208aed2f433cd2f46a7df016bad50af2e07e40 (patch)
tree66041d8354f6255f80595f1e7b1f293d5b0e8654 /rts
parentd68865de2aa654d91e57c17437559b005e00b909 (diff)
downloadhaskell-4d208aed2f433cd2f46a7df016bad50af2e07e40.tar.gz
When using -H with -M<size>, don't exceed the maximum heap size
Diffstat (limited to 'rts')
-rw-r--r--rts/sm/GC.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 1b81b260c9..53c35c9d7f 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