diff options
Diffstat (limited to 'ghc/compiler/parser/hschooks.c')
-rw-r--r-- | ghc/compiler/parser/hschooks.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/ghc/compiler/parser/hschooks.c b/ghc/compiler/parser/hschooks.c index a9fd56a3f5..d3836fe02a 100644 --- a/ghc/compiler/parser/hschooks.c +++ b/ghc/compiler/parser/hschooks.c @@ -4,14 +4,27 @@ for various bits of the RTS. They are linked in instead of the defaults. */ +#include <string.h> + #if __GLASGOW_HASKELL__ >= 400 -#include "Rts.h" +#include "../rts/Rts.h" #else #include "rtsdefs.h" #endif -#if __GLASGOW_HASKELL__ >= 408 +#if __GLASGOW_HASKELL__ >= 505 +#include "../rts/Rts.h" #include "../includes/RtsFlags.h" +#else +#include "Rts.h" +#include "RtsFlags.h" +#endif + +#if __GLASGOW_HASKELL__ >= 502 +#include "RtsFlags.h" +#endif + +#if __GLASGOW_HASKELL__ >= 408 #include "HsFFI.h" #endif @@ -19,6 +32,12 @@ in instead of the defaults. #include <unistd.h> #endif +#if __GLASGOW_HASKELL__ >= 504 + +char *ghc_rts_opts = "-H8m -K8m"; + +#else + void defaultsHook (void) { @@ -31,11 +50,12 @@ defaultsHook (void) RtsFlags.GcFlags.statsFile = stderr; #endif } +#endif void enableTimingStats( void ) /* called from the driver */ { -#if __GLASGOW_HASKELL__ >= 411 +#if __GLASGOW_HASKELL__ >= 505 RtsFlags.GcFlags.giveStats = ONELINE_GC_STATS; #endif /* ignored when bootstrapping with an older GHC */ @@ -69,7 +89,6 @@ PostTraceHook (long fd) #endif } -#if __GLASGOW_HASKELL__ >= 400 void OutOfHeapHook (unsigned long request_size, unsigned long heap_size) /* both in bytes */ @@ -85,24 +104,6 @@ StackOverflowHook (unsigned long stack_size) /* in bytes */ fprintf(stderr, "GHC stack-space overflow: current size %ld bytes.\nUse the `-K<size>' option to increase it.\n", stack_size); } -#else /* GHC < 4.00 */ - -void -OutOfHeapHook (W_ request_size, W_ heap_size) /* both in bytes */ -{ - fprintf(stderr, "GHC's heap exhausted;\nwhile trying to allocate %lu bytes in a %lu-byte heap;\nuse the `-H<size>' option to increase the total heap size.\n", - request_size, - heap_size); -} - -void -StackOverflowHook (I_ stack_size) /* in bytes */ -{ - fprintf(stderr, "GHC stack-space overflow: current size %ld bytes.\nUse the `-K<size>' option to increase it.\n", stack_size); -} - -#endif - HsInt ghc_strlen( HsAddr a ) { |