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,v 1.36 2004/04/19 07:55:28 starynke Exp $ */ 15 16 #ifndef CAML_CONFIG_H 17 #define CAML_CONFIG_H 18 19 #define ARCH_CODE32 20 #define ARCH_SIXTYFOUR 21 #define SIZEOF_INT 4 22 #define SIZEOF_LONG 8 23 #define SIZEOF_SHORT 2 24 #define ARCH_INT64_TYPE long 25 #define ARCH_UINT64_TYPE unsigned long 26 #define ARCH_INT64_PRINTF_FORMAT "l" 27 #undef ARCH_BIG_ENDIAN 28 #undef ARCH_ALIGN_DOUBLE 29 #undef ARCH_ALIGN_INT64 30 #undef NONSTANDARD_DIV_MOD 31 #define USE_MMAP_INSTEAD_OF_MALLOC 32 #define OCAML_OS_TYPE "Unix" 33 #define OCAML_STDLIB_DIR "/soft/ocaml-3.08.4/x86_64/lib/ocaml" 34 #define POSIX_SIGNALS 35 #define HAS_TIMES 36 #define HAS_TERMCAP 37 #define HAS_SOCKETS 38 #define HAS_SOCKLEN_T 39 #define HAS_INET_ATON 40 #define HAS_IPV6 41 #define HAS_UNISTD 42 #define HAS_OFF_T 43 #define HAS_DIRENT 44 #define HAS_REWINDDIR 45 #define HAS_LOCKF 46 #define HAS_MKFIFO 47 #define HAS_GETCWD 48 #define HAS_GETWD 49 #define HAS_GETPRIORITY 50 #define HAS_UTIME 51 #define HAS_UTIMES 52 #define HAS_DUP2 53 #define HAS_FCHMOD 54 #define HAS_TRUNCATE 55 #define HAS_SYS_SELECT_H 56 #define HAS_SELECT 57 #define HAS_SYMLINK 58 #define HAS_WAITPID 59 #define HAS_WAIT4 60 #define HAS_GETGROUPS 61 #define HAS_TERMIOS 62 #define HAS_ASYNC_IO 63 #define HAS_SETITIMER 64 #define HAS_GETHOSTNAME 65 #define HAS_UNAME 66 #define HAS_GETTIMEOFDAY 67 #define HAS_MKTIME 68 #define HAS_SETSID 69 #define HAS_PUTENV 70 #define HAS_LOCALE 71 #define SUPPORT_DYNAMIC_LINKING 72 #define HAS_MMAP 73 #define HAS_GETHOSTBYNAME_R 6 74 #define HAS_GETHOSTBYADDR_R 8 75 #define HAS_SIGWAIT 76 77 #ifndef CAML_NAME_SPACE 78 #include "compatibility.h" 79 #endif 80 81 /* Types for signed chars, 16-bit integers, 32-bit integers, 64-bit integers */ 82 83 typedef signed char schar; 84 85 typedef short int16; /* FIXME -- not true on the Cray T3E */ 86 typedef unsigned short uint16; /* FIXME -- not true on the Cray T3E */ 87 88 #if SIZEOF_INT == 4 89 typedef int int32; 90 typedef unsigned int uint32; 91 #elif SIZEOF_LONG == 4 92 typedef long int32; 93 typedef unsigned long uint32; 94 #elif SIZEOF_SHORT == 4 95 typedef short int32; 96 typedef unsigned short uint32; 97 #endif 98 99 #if defined(ARCH_INT64_TYPE) 100 typedef ARCH_INT64_TYPE int64; 101 typedef ARCH_UINT64_TYPE uint64; 102 #else 103 # if ARCH_BIG_ENDIAN 104 typedef struct { uint32 h, l; } uint64, int64; 105 # else 106 typedef struct { uint32 l, h; } uint64, int64; 107 # endif 108 #endif 109 110 /* Endianness of floats */ 111 112 /* ARCH_FLOAT_ENDIANNESS encodes the byte order of doubles as follows: 113 the value [0xabcdefgh] means that the least significant byte of the 114 float is at byte offset [a], the next lsb at [b], ..., and the 115 most significant byte at [h]. */ 116 117 #if defined(__arm__) 118 #define ARCH_FLOAT_ENDIANNESS 0x45670123 119 #elif defined(ARCH_BIG_ENDIAN) 120 #define ARCH_FLOAT_ENDIANNESS 0x76543210 121 #else 122 #define ARCH_FLOAT_ENDIANNESS 0x01234567 123 #endif 124 125 /* We use threaded code interpretation if the compiler provides labels 126 as first-class values (GCC 2.x). */ 127 128 #if defined(__GNUC__) && __GNUC__ >= 2 && !defined(DEBUG) && !defined (SHRINKED_GNUC) && !defined(CAML_JIT) 129 #define THREADED_CODE 130 #endif 131 132 133 /* Do not change this definition. */ 134 #define Page_size (1 << Page_log) 135 136 /* Memory model parameters */ 137 138 /* The size of a page for memory management (in bytes) is [1 << Page_log]. 139 It must be a multiple of [sizeof (long)]. */ 140 #define Page_log 12 /* A page is 4 kilobytes. */ 141 142 /* Initial size of stack (bytes). */ 143 #define Stack_size (4096 * sizeof(value)) 144 145 /* Minimum free size of stack (bytes); below that, it is reallocated. */ 146 #define Stack_threshold (256 * sizeof(value)) 147 148 /* Default maximum size of the stack (words). */ 149 #define Max_stack_def (256 * 1024) 150 151 152 /* Maximum size of a block allocated in the young generation (words). */ 153 /* Must be > 4 */ 154 #define Max_young_wosize 256 155 156 157 /* Minimum size of the minor zone (words). 158 This must be at least [Max_young_wosize + 1]. */ 159 #define Minor_heap_min 4096 160 161 /* Maximum size of the minor zone (words). 162 Must be greater than or equal to [Minor_heap_min]. 163 */ 164 #define Minor_heap_max (1 << 28) 165 166 /* Default size of the minor zone. (words) */ 167 #define Minor_heap_def 32768 168 169 170 /* Minimum size increment when growing the heap (words). 171 Must be a multiple of [Page_size / sizeof (value)]. */ 172 #define Heap_chunk_min (2 * Page_size / sizeof (value)) 173 174 /* Default size increment when growing the heap. (words) 175 Must be a multiple of [Page_size / sizeof (value)]. */ 176 #define Heap_chunk_def (15 * Page_size) 177 178 /* Default initial size of the major heap (words); 179 same constraints as for Heap_chunk_def. */ 180 #define Init_heap_def (15 * Page_size) 181 182 183 /* Default speed setting for the major GC. The heap will grow until 184 the dead objects and the free list represent this percentage of the 185 total size of live objects. */ 186 #define Percent_free_def 80 187 188 /* Default setting for the compacter: 500% 189 (i.e. trigger the compacter when 5/6 of the heap is free or garbage) 190 This can be set quite high because the overhead is over-estimated 191 when fragmentation occurs. 192 */ 193 #define Max_percent_free_def 500 194 195 196 #endif /* CAML_CONFIG_H */ 197