2 These utility routines are used various
3 places in the GHC library.
6 /* For GHC 4.08, we are relying on the fact that RtsFlags has
7 * compatible layout with the current version, because we're
8 * #including the current version of RtsFlags.h below. 4.08 didn't
9 * ship with its own RtsFlags.h, unfortunately. For later GHC
10 * versions, we #include the correct RtsFlags.h.
12 #if __GLASGOW_HASKELL__ < 502
13 #include "../includes/Rts.h"
14 #include "../includes/RtsFlags.h"
29 Calling 'strlen' and 'memcpy' directly gives problems with GCC's inliner,
30 and causes gcc to require too many registers on x84
34 ghc_strlen( HsAddr a )
36 return (strlen((char *)a));
40 ghc_memcmp( HsAddr a1, HsAddr a2, HsInt len )
42 return (memcmp((char *)a1, a2, len));
46 ghc_memcmp_off( HsAddr a1, HsInt i, HsAddr a2, HsInt len )
48 return (memcmp((char *)a1 + i, a2, len));
52 enableTimingStats( void ) /* called from the driver */
54 #if __GLASGOW_HASKELL__ >= 411
55 RtsFlags.GcFlags.giveStats = ONELINE_GC_STATS;
57 /* ignored when bootstrapping with an older GHC */
61 setHeapSize( HsInt size )
63 RtsFlags.GcFlags.heapSizeSuggestion = size / BLOCK_SIZE;
64 if (RtsFlags.GcFlags.maxHeapSize != 0 &&
65 RtsFlags.GcFlags.heapSizeSuggestion > RtsFlags.GcFlags.maxHeapSize) {
66 RtsFlags.GcFlags.maxHeapSize = RtsFlags.GcFlags.heapSizeSuggestion;