Fix scoped type variables for expression type signatures
[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 /* For GHC 4.08, we are relying on the fact that RtsFlags has
8  * compatible layout with the current version, because we're
9  * #including the current version of RtsFlags.h below.  4.08 didn't
10  * ship with its own RtsFlags.h, unfortunately.   For later GHC
11  * versions, we #include the correct RtsFlags.h.
12  */
13 #if __GLASGOW_HASKELL__ < 502
14 #include "../includes/Rts.h"
15 #include "../includes/RtsFlags.h"
16 #else
17 #include "Rts.h"
18 #include "RtsFlags.h"
19 #endif
20
21 #include "HsFFI.h"
22
23 #include <string.h>
24
25 #ifdef HAVE_UNISTD_H
26 #include <unistd.h>
27 #endif
28
29 void
30 defaultsHook (void)
31 {
32     RtsFlags.GcFlags.heapSizeSuggestion = 6*1024*1024 / BLOCK_SIZE;
33     RtsFlags.GcFlags.maxStkSize         = 8*1024*1024 / sizeof(W_);
34 #if __GLASGOW_HASKELL__ >= 411
35     /* GHC < 4.11 didn't have these */
36     RtsFlags.GcFlags.giveStats = COLLECT_GC_STATS;
37     RtsFlags.GcFlags.statsFile = stderr;
38 #endif
39 }
40
41 void
42 StackOverflowHook (unsigned long stack_size)    /* in bytes */
43 {
44     fprintf(stderr, "GHC stack-space overflow: current limit is %ld bytes.\nUse the `-K<size>' option to increase it.\n", stack_size);
45 }
46