X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fparser%2Fhschooks.c;fp=ghc%2Fcompiler%2Fparser%2Fhschooks.c;h=6d94290d5d0bca34bb9f8a6bc2f891d8208c1c7c;hb=b1bbd55b3398136c4944cdca9df05cb12eda03ba;hp=b44c04966bb1b8509f45b8ea360f4d962789cdc7;hpb=c887767d3ffa9d5ce292d38b0c091b6a23d66957;p=ghc-hetmet.git diff --git a/ghc/compiler/parser/hschooks.c b/ghc/compiler/parser/hschooks.c index b44c049..6d94290 100644 --- a/ghc/compiler/parser/hschooks.c +++ b/ghc/compiler/parser/hschooks.c @@ -10,6 +10,44 @@ 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; +#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