]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/contrib/byterun/config.h
update
[l4.git] / l4 / pkg / ocaml / contrib / byterun / config.h
1 /***********************************************************************/
2 /*                                                                     */
3 /*                           Objective Caml                            */
4 /*                                                                     */
5 /*         Xavier Leroy and Damien Doligez, INRIA Rocquencourt         */
6 /*                                                                     */
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.     */
11 /*                                                                     */
12 /***********************************************************************/
13
14 /* $Id: config.h 9117 2008-11-02 14:30:05Z xleroy $ */
15
16 #ifndef CAML_CONFIG_H
17 #define CAML_CONFIG_H
18
19 /* <include ../config/m.h> */
20 /* <include ../config/s.h> */
21 /* <private> */
22 #include "../config/m.h"
23 #include "../config/s.h"
24 /* </private> */
25
26 #ifndef CAML_NAME_SPACE
27 #include "compatibility.h"
28 #endif
29
30 /* Types for signed chars, 32-bit integers, 64-bit integers,
31    native integers (as wide as a pointer type) */
32
33 typedef signed char schar;
34
35 #if SIZEOF_PTR == SIZEOF_LONG
36 /* Standard models: ILP32 or I32LP64 */
37 typedef long intnat;
38 typedef unsigned long uintnat;
39 #define ARCH_INTNAT_PRINTF_FORMAT "l"
40 #elif SIZEOF_PTR == SIZEOF_INT
41 /* Hypothetical IP32L64 model */
42 typedef int intnat;
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
50 #else
51 #error "No integer type available to represent pointers"
52 #endif
53
54 #if SIZEOF_INT == 4
55 typedef int int32;
56 typedef unsigned int uint32;
57 #define ARCH_INT32_PRINTF_FORMAT ""
58 #elif SIZEOF_LONG == 4
59 typedef long int32;
60 typedef unsigned long uint32;
61 #define ARCH_INT32_PRINTF_FORMAT "l"
62 #elif SIZEOF_SHORT == 4
63 typedef short int32;
64 typedef unsigned short uint32;
65 #define ARCH_INT32_PRINTF_FORMAT ""
66 #else
67 #error "No 32-bit integer type available"
68 #endif
69
70 #if defined(ARCH_INT64_TYPE)
71 typedef ARCH_INT64_TYPE int64;
72 typedef ARCH_UINT64_TYPE uint64;
73 #else
74 #  ifdef ARCH_BIG_ENDIAN
75 typedef struct { uint32 h, l; } uint64, int64;
76 #  else
77 typedef struct { uint32 l, h; } uint64, int64;
78 #  endif
79 #endif
80
81 /* Endianness of floats */
82
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]. */
87
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
92 #else
93 #define ARCH_FLOAT_ENDIANNESS 0x01234567
94 #endif
95
96 /* We use threaded code interpretation if the compiler provides labels
97    as first-class values (GCC 2.x). */
98
99 #if defined(__GNUC__) && __GNUC__ >= 2 && !defined(DEBUG) && !defined (SHRINKED_GNUC) && !defined(CAML_JIT)
100 #define THREADED_CODE
101 #endif
102
103
104 /* Do not change this definition. */
105 #define Page_size (1 << Page_log)
106
107 /* Memory model parameters */
108
109 /* The size of a page for memory management (in bytes) is [1 << Page_log].
110    It must be a multiple of [sizeof (value)] and >= 8 and <= 20. */
111 #define Page_log 12             /* A page is 4 kilobytes. */
112
113 /* Initial size of stack (bytes). */
114 #define Stack_size (4096 * sizeof(value))
115
116 /* Minimum free size of stack (bytes); below that, it is reallocated. */
117 #define Stack_threshold (256 * sizeof(value))
118
119 /* Default maximum size of the stack (words). */
120 #define Max_stack_def (1024 * 1024)
121
122
123 /* Maximum size of a block allocated in the young generation (words). */
124 /* Must be > 4 */
125 #define Max_young_wosize 256
126
127
128 /* Minimum size of the minor zone (words).
129    This must be at least [Max_young_wosize + 1]. */
130 #define Minor_heap_min 4096
131
132 /* Maximum size of the minor zone (words).
133    Must be greater than or equal to [Minor_heap_min].
134 */
135 #define Minor_heap_max (1 << 28)
136
137 /* Default size of the minor zone. (words)  */
138 #define Minor_heap_def 32768
139
140
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))
144
145 /* Default size increment when growing the heap. (words)
146    Must be a multiple of [Page_size / sizeof (value)].
147    (Approx 512 Kb for a 32-bit platform, 1 Mb for a 64-bit platform.) */
148 #define Heap_chunk_def (31 * Page_size)
149
150 /* Default initial size of the major heap (words);
151    same constraints as for Heap_chunk_def. */
152 #define Init_heap_def (31 * Page_size)
153
154
155 /* Default speed setting for the major GC.  The heap will grow until
156    the dead objects and the free list represent this percentage of the
157    total size of live objects. */
158 #define Percent_free_def 80
159
160 /* Default setting for the compacter: 500%
161    (i.e. trigger the compacter when 5/6 of the heap is free or garbage)
162    This can be set quite high because the overhead is over-estimated
163    when fragmentation occurs.
164  */
165 #define Max_percent_free_def 500
166
167
168 #endif /* CAML_CONFIG_H */