File: cutils.c

package info (click to toggle)
haskell-ghc-lib-parser 9.6.6.20240701-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,280 kB
  • sloc: haskell: 109,582; yacc: 3,744; ansic: 2,480; makefile: 12
file content (24 lines) | stat: -rw-r--r-- 565 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
These utility routines are used various
places in the GHC library.
*/

#include <Rts.h>

#include <HsFFI.h>

void
ghc_lib_parser_enableTimingStats( void )       /* called from the driver */
{
    RtsFlags.GcFlags.giveStats = ONELINE_GC_STATS;
}

void
ghc_lib_parser_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;
    }
}