summaryrefslogtreecommitdiff
path: root/ghc/hschooks.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-08-21 11:57:55 +0100
committerSimon Marlow <marlowsd@gmail.com>2012-08-21 11:57:55 +0100
commit4752385d4beb2d07a79643b87c7d27ea1f81aeb5 (patch)
tree08daff3e3b2db18e5427050d7509cacbceb2c05c /ghc/hschooks.c
parenta68df77ede928e6c7790dacb5925625792a904d3 (diff)
downloadhaskell-4752385d4beb2d07a79643b87c7d27ea1f81aeb5.tar.gz
Improve compile times by enabling +RTS -H for GHC (only when bootstrapped)
Diffstat (limited to 'ghc/hschooks.c')
-rw-r--r--ghc/hschooks.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ghc/hschooks.c b/ghc/hschooks.c
index 232ac08045..b8a720b209 100644
--- a/ghc/hschooks.c
+++ b/ghc/hschooks.c
@@ -18,7 +18,15 @@ in instead of the defaults.
void
defaultsHook (void)
{
+#if __GLASGOW_HASKELL__ >= 707
+ // This helps particularly with large compiles, but didn't work
+ // very well with earlier GHCs because it caused large amounts of
+ // fragmentation. See rts/sm/BlockAlloc.c:allocLargeChunk().
+ RtsFlags.GcFlags.heapSizeSuggestionAuto = rtsTrue;
+#else
RtsFlags.GcFlags.heapSizeSuggestion = 6*1024*1024 / BLOCK_SIZE;
+#endif
+
RtsFlags.GcFlags.maxStkSize = 512*1024*1024 / sizeof(W_);
RtsFlags.GcFlags.giveStats = COLLECT_GC_STATS;