forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.h
121 lines (87 loc) · 3.75 KB
/
options.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// This file is a part of Julia. License is MIT: https://julialang.org/license
#ifndef JL_OPTIONS_H
#define JL_OPTIONS_H
// Options in here are NOT allowed to affect the jlapi, since that would require this header to be installed
// Build-time options for debugging, tweaking, and selecting alternative
// implementations of core features.
//
// object layout options ------------------------------------------------------
// how much space we're willing to waste if an array outgrows its
// original object
#define ARRAY_INLINE_NBYTES (2048*sizeof(void*))
// codegen options ------------------------------------------------------------
// (Experimental) Use MCJIT ELF, even where it's not the native format
//#define FORCE_ELF
// with KEEP_BODIES, we keep LLVM function bodies around for later debugging
// #define KEEP_BODIES
// GC options -----------------------------------------------------------------
// debugging options
// with MEMDEBUG, every object is allocated explicitly with malloc, and
// filled with 0xbb before being freed. this helps tools like valgrind
// catch invalid accesses.
// #define MEMDEBUG
// GC_VERIFY force a full verification gc along with every quick gc to ensure no
// reachable memory is freed
#ifndef GC_VERIFY
#ifdef GC_DEBUG_ENV
#define GC_VERIFY
#else
// It is recommanded to use the WITH_GC_VERIFY make option to turn on this
// option. Keep the document here before a better build system is ready.
// #define GC_VERIFY
#endif
#endif
// SEGV_EXCEPTION turns segmentation faults into catchable julia exceptions.
// This is not recommended, as the memory state after such an exception should
// be considered untrusted, but can be helpful during development
// #define SEGV_EXCEPTION
// profiling options
// GC_FINAL_STATS prints total GC stats at exit
// #define GC_FINAL_STATS
// MEMPROFILE prints pool summary statistics after every GC
//#define MEMPROFILE
// GCTIME prints time taken by each phase of GC
//#define GC_TIME
// OBJPROFILE counts objects by type
//#define OBJPROFILE
// method dispatch profiling --------------------------------------------------
// turn type inference on/off. this is for internal debugging only, and must be
// turned on for all practical purposes.
#define ENABLE_INFERENCE
// print all signatures type inference is invoked on
//#define TRACE_INFERENCE
// print all generic method dispatches (excludes inlined and specialized call
// sites). this generally prints too much output to be useful.
//#define JL_TRACE
// count generic (not inlined or specialized) calls to each function. recorded
// in the `ncalls` field of jl_methtable_t.
//#define JL_GF_PROFILE
// task options ---------------------------------------------------------------
// select an implementation of stack switching.
// currently only COPY_STACKS is recommended.
#ifndef COPY_STACKS
#define COPY_STACKS
#endif
// threading options ----------------------------------------------------------
// controls for when threads sleep
#define THREAD_SLEEP_THRESHOLD_NAME "JULIA_THREAD_SLEEP_THRESHOLD"
#define DEFAULT_THREAD_SLEEP_THRESHOLD 1e9 // cycles (1e9==1sec@1GHz)
// defaults for # threads
#define NUM_THREADS_NAME "JULIA_NUM_THREADS"
#define DEFAULT_NUM_THREADS 4
// affinitization behavior
#define MACHINE_EXCLUSIVE_NAME "JULIA_EXCLUSIVE"
#define DEFAULT_MACHINE_EXCLUSIVE 0
// sanitizer defaults ---------------------------------------------------------
// Automatically enable MEMDEBUG and KEEP_BODIES for the sanitizers
#if defined(__has_feature)
# if __has_feature(address_sanitizer) || __has_feature(memory_sanitizer)
# define MEMDEBUG
# define KEEP_BODIES
# endif
// Memory sanitizer also needs thread-local storage
# if __has_feature(memory_sanitizer)
# define CODEGEN_TLS
# endif
#endif
#endif