<commit_before>/*
These routines customise the error messages
for various bits of the RTS.  They are linked
in instead of the defaults.
*/

#if __GLASGOW_HASKELL__ >= 400
#include "Rts.h"
#else
#include "rtsdefs.h"
#endif

#if __GLASGOW_HASKELL__ >= 408
#include "../includes/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
ErrorHdrHook (long fd)
{
    char msg[]="\n";
    write(fd,msg,1);
}
<commit_msg>[project @ 2001-08-10 10:57:23 by simonmar] Fix another place where the maxHeapSize is set to the heapSizeSuggestion, now that maxHeapSize == 0 indicates "unbounded".<commit_after>/*
These routines customise the error messages
for various bits of the RTS.  They are linked
in instead of the defaults.
*/

#if __GLASGOW_HASKELL__ >= 400
#include "Rts.h"
#else
#include "rtsdefs.h"
#endif

#if __GLASGOW_HASKELL__ >= 408
#include "../includes/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.maxHeapSize != 0 &&
	RtsFlags.GcFlags.heapSizeSuggestion > RtsFlags.GcFlags.maxHeapSize) {
	RtsFlags.GcFlags.maxHeapSize = RtsFlags.GcFlags.heapSizeSuggestion;
    }
#endif
}

#if __GLASGOW_HASKELL__ >= 303

void
ErrorHdrHook (long fd)
{
    char msg[]="\n";
    write(fd,msg,1);
}

{'fraction_non_alphanumeric': 0.11062109518559353, 'fraction_numerical': 0.03528114663726571, 'mean_word_length': 4.254826254826255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3720318', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1076, 'n_words': 233}