X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fparser%2Fhschooks.c;h=de549363dc519cf065a515685d9f6e8cc93df192;hb=225d251337438e2f7870f0ec2781b1c616ef7462;hp=a2cc2e4e501a426e3fecd130f78f3df7c1ce2380;hpb=438596897ebbe25a07e1c82085cfbc5bdb00f09e;p=ghc-hetmet.git diff --git a/ghc/compiler/parser/hschooks.c b/ghc/compiler/parser/hschooks.c index a2cc2e4..de54936 100644 --- a/ghc/compiler/parser/hschooks.c +++ b/ghc/compiler/parser/hschooks.c @@ -10,6 +10,45 @@ in instead of the defaults. #include "rtsdefs.h" #endif +#if __GLASGOW_HASKELL__ >= 408 +#include "../rts/RtsFlags.h" +#include "HsFFI.h" +#endif + +void +defaultsHook (void) +{ +#if __GLASGOW_HASKELL__ >= 408 + RtsFlags.GcFlags.heapSizeSuggestion = 6*1024*1024 / BLOCK_SIZE; + RtsFlags.GcFlags.maxStkSize = 8*1024*1024 / sizeof(W_); +#endif +#if __GLASGOW_HASKELL__ >= 411 + RtsFlags.GcFlags.giveStats = COLLECT_GC_STATS; + RtsFlags.GcFlags.statsFile = stderr; +#endif +} + +void +enableTimingStats( void ) /* called from the driver */ +{ +#if __GLASGOW_HASKELL__ >= 411 + RtsFlags.GcFlags.giveStats = ONELINE_GC_STATS; +#endif + /* ignored when bootstrapping with an older GHC */ +} + +void +setHeapSize( HsInt size ) +{ +#if __GLASGOW_HASKELL__ >= 408 + RtsFlags.GcFlags.heapSizeSuggestion = size / BLOCK_SIZE; + if (RtsFlags.GcFlags.heapSizeSuggestion > + RtsFlags.GcFlags.maxHeapSize) { + RtsFlags.GcFlags.maxHeapSize = RtsFlags.GcFlags.heapSizeSuggestion; + } +#endif +} + #if __GLASGOW_HASKELL__ >= 303 void @@ -22,7 +61,7 @@ ErrorHdrHook (long fd) void PatErrorHdrHook (long fd) { - const char msg[]="\n*** Pattern-matching error within GHC!\n\nThis is a compiler bug; please report it to glasgow-haskell-bugs@dcs.gla.ac.uk.\n\nFail:"; + const char msg[]="\n*** Pattern-matching error within GHC!\n\nThis is a compiler bug; please report it to glasgow-haskell-bugs@haskell.org.\n\nFail:"; write(fd,msg,sizeof(msg)-1); } @@ -53,7 +92,7 @@ ErrorHdrHook (FILE *where) void PatErrorHdrHook (FILE *where) { - fprintf(where, "\n*** Pattern-matching error within GHC!\n\nThis is a compiler bug; please report it to glasgow-haskell-bugs@dcs.gla.ac.uk.\n\nFail: "); + fprintf(where, "\n*** Pattern-matching error within GHC!\n\nThis is a compiler bug; please report it to glasgow-haskell-bugs@haskell.org.\n\nFail: "); } void