jemalloc_internal_defs.h.in revision 748dfac7788e3cbc2fc6d36196a81d3f002669f6
1/*
2 * If JEMALLOC_PREFIX is defined via --with-jemalloc-prefix, it will cause all
3 * public APIs to be prefixed.  This makes it possible, with some care, to use
4 * multiple allocators simultaneously.
5 */
6#undef JEMALLOC_PREFIX
7#undef JEMALLOC_CPREFIX
8
9/*
10 * JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs.
11 * For shared libraries, symbol visibility mechanisms prevent these symbols
12 * from being exported, but for static libraries, naming collisions are a real
13 * possibility.
14 */
15#undef JEMALLOC_PRIVATE_NAMESPACE
16
17/*
18 * Hyper-threaded CPUs may need a special instruction inside spin loops in
19 * order to yield to another virtual CPU.
20 */
21#undef CPU_SPINWAIT
22
23/* Defined if the equivalent of FreeBSD's atomic(9) functions are available. */
24#undef JEMALLOC_ATOMIC9
25
26/*
27 * Defined if OSAtomic*() functions are available, as provided by Darwin, and
28 * documented in the atomic(3) manual page.
29 */
30#undef JEMALLOC_OSATOMIC
31
32/*
33 * Defined if __sync_add_and_fetch(uint32_t *, uint32_t) and
34 * __sync_sub_and_fetch(uint32_t *, uint32_t) are available, despite
35 * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 not being defined (which means the
36 * functions are defined in libgcc instead of being inlines)
37 */
38#undef JE_FORCE_SYNC_COMPARE_AND_SWAP_4
39
40/*
41 * Defined if __sync_add_and_fetch(uint64_t *, uint64_t) and
42 * __sync_sub_and_fetch(uint64_t *, uint64_t) are available, despite
43 * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 not being defined (which means the
44 * functions are defined in libgcc instead of being inlines)
45 */
46#undef JE_FORCE_SYNC_COMPARE_AND_SWAP_8
47
48/*
49 * Defined if OSSpin*() functions are available, as provided by Darwin, and
50 * documented in the spinlock(3) manual page.
51 */
52#undef JEMALLOC_OSSPIN
53
54/*
55 * Defined if _malloc_thread_cleanup() exists.  At least in the case of
56 * FreeBSD, pthread_key_create() allocates, which if used during malloc
57 * bootstrapping will cause recursion into the pthreads library.  Therefore, if
58 * _malloc_thread_cleanup() exists, use it as the basis for thread cleanup in
59 * malloc_tsd.
60 */
61#undef JEMALLOC_MALLOC_THREAD_CLEANUP
62
63/*
64 * Defined if threaded initialization is known to be safe on this platform.
65 * Among other things, it must be possible to initialize a mutex without
66 * triggering allocation in order for threaded allocation to be safe.
67 */
68#undef JEMALLOC_THREADED_INIT
69
70/*
71 * Defined if the pthreads implementation defines
72 * _pthread_mutex_init_calloc_cb(), in which case the function is used in order
73 * to avoid recursive allocation during mutex initialization.
74 */
75#undef JEMALLOC_MUTEX_INIT_CB
76
77/* Defined if sbrk() is supported. */
78#undef JEMALLOC_HAVE_SBRK
79
80/* Non-empty if the tls_model attribute is supported. */
81#undef JEMALLOC_TLS_MODEL
82
83/* JEMALLOC_CC_SILENCE enables code that silences unuseful compiler warnings. */
84#undef JEMALLOC_CC_SILENCE
85
86/* JEMALLOC_CODE_COVERAGE enables test code coverage analysis. */
87#undef JEMALLOC_CODE_COVERAGE
88
89/*
90 * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
91 * inline functions.
92 */
93#undef JEMALLOC_DEBUG
94
95/* JEMALLOC_STATS enables statistics calculation. */
96#undef JEMALLOC_STATS
97
98/* JEMALLOC_PROF enables allocation profiling. */
99#undef JEMALLOC_PROF
100
101/* Use libunwind for profile backtracing if defined. */
102#undef JEMALLOC_PROF_LIBUNWIND
103
104/* Use libgcc for profile backtracing if defined. */
105#undef JEMALLOC_PROF_LIBGCC
106
107/* Use gcc intrinsics for profile backtracing if defined. */
108#undef JEMALLOC_PROF_GCC
109
110/*
111 * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects.
112 * This makes it possible to allocate/deallocate objects without any locking
113 * when the cache is in the steady state.
114 */
115#undef JEMALLOC_TCACHE
116
117/*
118 * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage
119 * segment (DSS).
120 */
121#undef JEMALLOC_DSS
122
123/* Support memory filling (junk/zero/quarantine/redzone). */
124#undef JEMALLOC_FILL
125
126/* Support utrace(2)-based tracing. */
127#undef JEMALLOC_UTRACE
128
129/* Support Valgrind. */
130#undef JEMALLOC_VALGRIND
131
132/* Support optional abort() on OOM. */
133#undef JEMALLOC_XMALLOC
134
135/* Support lazy locking (avoid locking unless a second thread is launched). */
136#undef JEMALLOC_LAZY_LOCK
137
138/* One page is 2^STATIC_PAGE_SHIFT bytes. */
139#undef STATIC_PAGE_SHIFT
140
141/*
142 * If defined, use munmap() to unmap freed chunks, rather than storing them for
143 * later reuse.  This is disabled by default on Linux because common sequences
144 * of mmap()/munmap() calls will cause virtual memory map holes.
145 */
146#undef JEMALLOC_MUNMAP
147
148/*
149 * If defined, use mremap(...MREMAP_FIXED...) for huge realloc().  This is
150 * disabled by default because it is Linux-specific and it will cause virtual
151 * memory map holes, much like munmap(2) does.
152 */
153#undef JEMALLOC_MREMAP
154
155/* TLS is used to map arenas and magazine caches to threads. */
156#undef JEMALLOC_TLS
157
158/*
159 * JEMALLOC_IVSALLOC enables ivsalloc(), which verifies that pointers reside
160 * within jemalloc-owned chunks before dereferencing them.
161 */
162#undef JEMALLOC_IVSALLOC
163
164/*
165 * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings.
166 */
167#undef JEMALLOC_ZONE
168#undef JEMALLOC_ZONE_VERSION
169
170/*
171 * Methods for purging unused pages differ between operating systems.
172 *
173 *   madvise(..., MADV_DONTNEED) : On Linux, this immediately discards pages,
174 *                                 such that new pages will be demand-zeroed if
175 *                                 the address region is later touched.
176 *   madvise(..., MADV_FREE) : On FreeBSD and Darwin, this marks pages as being
177 *                             unused, such that they will be discarded rather
178 *                             than swapped out.
179 */
180#undef JEMALLOC_PURGE_MADVISE_DONTNEED
181#undef JEMALLOC_PURGE_MADVISE_FREE
182
183/*
184 * Define if operating system has alloca.h header.
185 */
186#undef JEMALLOC_HAS_ALLOCA_H
187
188/* sizeof(int) == 2^LG_SIZEOF_INT. */
189#undef LG_SIZEOF_INT
190
191/* sizeof(long) == 2^LG_SIZEOF_LONG. */
192#undef LG_SIZEOF_LONG
193
194/* sizeof(intmax_t) == 2^LG_SIZEOF_INTMAX_T. */
195#undef LG_SIZEOF_INTMAX_T
196