1 /***********************************************************************/
5 /* Xavier Leroy and Damien Doligez, INRIA Rocquencourt */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../LICENSE. */
12 /***********************************************************************/
19 /* <include ../config/m.h> */
20 /* <include ../config/s.h> */
22 #include "../config/m.h"
23 #include "../config/s.h"
26 #ifndef CAML_NAME_SPACE
27 #include "compatibility.h"
30 /* Types for signed chars, 32-bit integers, 64-bit integers,
31 native integers (as wide as a pointer type) */
33 typedef signed char schar
;
35 #if SIZEOF_PTR == SIZEOF_LONG
36 /* Standard models: ILP32 or I32LP64 */
38 typedef unsigned long uintnat
;
39 #define ARCH_INTNAT_PRINTF_FORMAT "l"
40 #elif SIZEOF_PTR == SIZEOF_INT
41 /* Hypothetical IP32L64 model */
43 typedef unsigned int uintnat
;
44 #define ARCH_INTNAT_PRINTF_FORMAT ""
45 #elif SIZEOF_PTR == 8 && defined(ARCH_INT64_TYPE)
46 /* Win64 model: IL32LLP64 */
47 typedef ARCH_INT64_TYPE intnat
;
48 typedef ARCH_UINT64_TYPE uintnat
;
49 #define ARCH_INTNAT_PRINTF_FORMAT ARCH_INT64_PRINTF_FORMAT
51 #error "No integer type available to represent pointers"
56 typedef unsigned int uint32
;
57 #define ARCH_INT32_PRINTF_FORMAT ""
58 #elif SIZEOF_LONG == 4
60 typedef unsigned long uint32
;
61 #define ARCH_INT32_PRINTF_FORMAT "l"
62 #elif SIZEOF_SHORT == 4
64 typedef unsigned short uint32
;
65 #define ARCH_INT32_PRINTF_FORMAT ""
67 #error "No 32-bit integer type available"
70 #if defined(ARCH_INT64_TYPE)
71 typedef ARCH_INT64_TYPE int64
;
72 typedef ARCH_UINT64_TYPE uint64
;
74 # ifdef ARCH_BIG_ENDIAN
75 typedef struct { uint32 h
, l
; } uint64
, int64
;
77 typedef struct { uint32 l
, h
; } uint64
, int64
;
81 /* Endianness of floats */
83 /* ARCH_FLOAT_ENDIANNESS encodes the byte order of doubles as follows:
84 the value [0xabcdefgh] means that the least significant byte of the
85 float is at byte offset [a], the next lsb at [b], ..., and the
86 most significant byte at [h]. */
88 #if defined(__arm__) && !defined(__ARM_EABI__)
89 #define ARCH_FLOAT_ENDIANNESS 0x45670123
90 #elif defined(ARCH_BIG_ENDIAN)
91 #define ARCH_FLOAT_ENDIANNESS 0x76543210
93 #define ARCH_FLOAT_ENDIANNESS 0x01234567
96 /* We use threaded code interpretation if the compiler provides labels
97 as first-class values (GCC 2.x). */
99 #if defined(__GNUC__) && __GNUC__ >= 2 && !defined(DEBUG) && !defined (SHRINKED_GNUC) && !defined(CAML_JIT)
100 #define THREADED_CODE
104 /* Do not change this definition. */
105 #define Page_size (1 << Page_log)
107 /* Memory model parameters */
109 /* The size of a page for memory management (in bytes) is [1 << Page_log].
110 It must be a multiple of [sizeof (value)]. */
111 #define Page_log 12 /* A page is 4 kilobytes. */
113 /* Initial size of stack (bytes). */
114 #define Stack_size (4096 * sizeof(value))
116 /* Minimum free size of stack (bytes); below that, it is reallocated. */
117 #define Stack_threshold (256 * sizeof(value))
119 /* Default maximum size of the stack (words). */
120 #define Max_stack_def (1024 * 1024)
123 /* Maximum size of a block allocated in the young generation (words). */
125 #define Max_young_wosize 256
128 /* Minimum size of the minor zone (words).
129 This must be at least [Max_young_wosize + 1]. */
130 #define Minor_heap_min 4096
132 /* Maximum size of the minor zone (words).
133 Must be greater than or equal to [Minor_heap_min].
135 #define Minor_heap_max (1 << 28)
137 /* Default size of the minor zone. (words) */
138 #define Minor_heap_def 32768
141 /* Minimum size increment when growing the heap (words).
142 Must be a multiple of [Page_size / sizeof (value)]. */
143 #define Heap_chunk_min (2 * Page_size / sizeof (value))
145 /* Default size increment when growing the heap. (words)
146 Must be a multiple of [Page_size / sizeof (value)]. */
147 #define Heap_chunk_def (15 * Page_size)
149 /* Default initial size of the major heap (words);
150 same constraints as for Heap_chunk_def. */
151 #define Init_heap_def (15 * Page_size)
154 /* Default speed setting for the major GC. The heap will grow until
155 the dead objects and the free list represent this percentage of the
156 total size of live objects. */
157 #define Percent_free_def 80
159 /* Default setting for the compacter: 500%
160 (i.e. trigger the compacter when 5/6 of the heap is free or garbage)
161 This can be set quite high because the overhead is over-estimated
162 when fragmentation occurs.
164 #define Max_percent_free_def 500
167 #endif /* CAML_CONFIG_H */