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