diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2019-12-25 07:37:30 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-12-26 14:09:11 -0500 |
commit | 3b17114dc360689651f2005126f5dc25510a7263 (patch) | |
tree | 15f1e0a12fdc747c0fa56974cbc9f6842b441617 /compiler/cbits | |
parent | 776df719905b2d39845268a87026bfec90b2795f (diff) | |
download | haskell-3b17114dc360689651f2005126f5dc25510a7263.tar.gz |
Minor refactor in ghc.cabal.in:
- Remove outdated comments
- Move cutils.c from parser to cbits
- Remove unused cutils.h
Diffstat (limited to 'compiler/cbits')
-rw-r--r-- | compiler/cbits/cutils.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/compiler/cbits/cutils.c b/compiler/cbits/cutils.c new file mode 100644 index 0000000000..fb7e3f7335 --- /dev/null +++ b/compiler/cbits/cutils.c @@ -0,0 +1,24 @@ +/* +These utility routines are used various +places in the GHC library. +*/ + +#include <Rts.h> + +#include <HsFFI.h> + +void +enableTimingStats( void ) /* called from the driver */ +{ + RtsFlags.GcFlags.giveStats = ONELINE_GC_STATS; +} + +void +setHeapSize( HsInt size ) +{ + RtsFlags.GcFlags.heapSizeSuggestion = size / BLOCK_SIZE; + if (RtsFlags.GcFlags.maxHeapSize != 0 && + RtsFlags.GcFlags.heapSizeSuggestion > RtsFlags.GcFlags.maxHeapSize) { + RtsFlags.GcFlags.maxHeapSize = RtsFlags.GcFlags.heapSizeSuggestion; + } +} |