bump GHC's maximum stack size to 64Mb (see #2002)
[ghc-hetmet.git] / compiler / parser / hschooks.c
1 /*
2 These routines customise the error messages
3 for various bits of the RTS.  They are linked
4 in instead of the defaults.
5 */
6
7 #include "Rts.h"
8 #include "RtsFlags.h"
9
10 #include "HsFFI.h"
11
12 #include <string.h>
13
14 #ifdef HAVE_UNISTD_H
15 #include <unistd.h>
16 #endif
17
18 void
19 defaultsHook (void)
20 {
21     RtsFlags.GcFlags.heapSizeSuggestion = 6*1024*1024 / BLOCK_SIZE;
22     RtsFlags.GcFlags.maxStkSize         = 64*1024*1024 / sizeof(W_);
23     RtsFlags.GcFlags.giveStats = COLLECT_GC_STATS;
24     RtsFlags.GcFlags.statsFile = stderr;
25 }
26
27 void
28 StackOverflowHook (unsigned long stack_size)    /* in bytes */
29 {
30     fprintf(stderr, "GHC stack-space overflow: current limit is %ld bytes.\nUse the `-K<size>' option to increase it.\n", stack_size);
31 }
32