]>
git.proxmox.com Git - rustc.git/blob - src/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h.in
1 #ifndef JEMALLOC_INTERNAL_DEFS_H_
2 #define JEMALLOC_INTERNAL_DEFS_H_
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.
9 #undef JEMALLOC_CPREFIX
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
17 #undef JEMALLOC_PRIVATE_NAMESPACE
20 * Hyper-threaded CPUs may need a special instruction inside spin loops in
21 * order to yield to another virtual CPU.
25 /* Defined if C11 atomics are available. */
26 #undef JEMALLOC_C11ATOMICS
28 /* Defined if the equivalent of FreeBSD's atomic(9) functions are available. */
29 #undef JEMALLOC_ATOMIC9
32 * Defined if OSAtomic*() functions are available, as provided by Darwin, and
33 * documented in the atomic(3) manual page.
35 #undef JEMALLOC_OSATOMIC
38 * Defined if __sync_add_and_fetch(uint32_t *, uint32_t) and
39 * __sync_sub_and_fetch(uint32_t *, uint32_t) are available, despite
40 * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 not being defined (which means the
41 * functions are defined in libgcc instead of being inlines).
43 #undef JE_FORCE_SYNC_COMPARE_AND_SWAP_4
46 * Defined if __sync_add_and_fetch(uint64_t *, uint64_t) and
47 * __sync_sub_and_fetch(uint64_t *, uint64_t) are available, despite
48 * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 not being defined (which means the
49 * functions are defined in libgcc instead of being inlines).
51 #undef JE_FORCE_SYNC_COMPARE_AND_SWAP_8
54 * Defined if __builtin_clz() and __builtin_clzl() are available.
56 #undef JEMALLOC_HAVE_BUILTIN_CLZ
59 * Defined if madvise(2) is available.
61 #undef JEMALLOC_HAVE_MADVISE
64 * Defined if OSSpin*() functions are available, as provided by Darwin, and
65 * documented in the spinlock(3) manual page.
67 #undef JEMALLOC_OSSPIN
70 * Defined if secure_getenv(3) is available.
72 #undef JEMALLOC_HAVE_SECURE_GETENV
75 * Defined if issetugid(2) is available.
77 #undef JEMALLOC_HAVE_ISSETUGID
80 * Defined if _malloc_thread_cleanup() exists. At least in the case of
81 * FreeBSD, pthread_key_create() allocates, which if used during malloc
82 * bootstrapping will cause recursion into the pthreads library. Therefore, if
83 * _malloc_thread_cleanup() exists, use it as the basis for thread cleanup in
86 #undef JEMALLOC_MALLOC_THREAD_CLEANUP
89 * Defined if threaded initialization is known to be safe on this platform.
90 * Among other things, it must be possible to initialize a mutex without
91 * triggering allocation in order for threaded allocation to be safe.
93 #undef JEMALLOC_THREADED_INIT
96 * Defined if the pthreads implementation defines
97 * _pthread_mutex_init_calloc_cb(), in which case the function is used in order
98 * to avoid recursive allocation during mutex initialization.
100 #undef JEMALLOC_MUTEX_INIT_CB
102 /* Non-empty if the tls_model attribute is supported. */
103 #undef JEMALLOC_TLS_MODEL
105 /* JEMALLOC_CC_SILENCE enables code that silences unuseful compiler warnings. */
106 #undef JEMALLOC_CC_SILENCE
108 /* JEMALLOC_CODE_COVERAGE enables test code coverage analysis. */
109 #undef JEMALLOC_CODE_COVERAGE
112 * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
115 #undef JEMALLOC_DEBUG
117 /* JEMALLOC_STATS enables statistics calculation. */
118 #undef JEMALLOC_STATS
120 /* JEMALLOC_PROF enables allocation profiling. */
123 /* Use libunwind for profile backtracing if defined. */
124 #undef JEMALLOC_PROF_LIBUNWIND
126 /* Use libgcc for profile backtracing if defined. */
127 #undef JEMALLOC_PROF_LIBGCC
129 /* Use gcc intrinsics for profile backtracing if defined. */
130 #undef JEMALLOC_PROF_GCC
133 * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects.
134 * This makes it possible to allocate/deallocate objects without any locking
135 * when the cache is in the steady state.
137 #undef JEMALLOC_TCACHE
140 * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage
145 /* Support memory filling (junk/zero/quarantine/redzone). */
148 /* Support utrace(2)-based tracing. */
149 #undef JEMALLOC_UTRACE
151 /* Support Valgrind. */
152 #undef JEMALLOC_VALGRIND
154 /* Support optional abort() on OOM. */
155 #undef JEMALLOC_XMALLOC
157 /* Support lazy locking (avoid locking unless a second thread is launched). */
158 #undef JEMALLOC_LAZY_LOCK
160 /* Minimum size class to support is 2^LG_TINY_MIN bytes. */
164 * Minimum allocation alignment is 2^LG_QUANTUM bytes (ignoring tiny size
169 /* One page is 2^LG_PAGE bytes. */
173 * If defined, adjacent virtual memory mappings with identical attributes
174 * automatically coalesce, and they fragment when changes are made to subranges.
175 * This is the normal order of things for mmap()/munmap(), but on Windows
176 * VirtualAlloc()/VirtualFree() operations must be precisely matched, i.e.
177 * mappings do *not* coalesce/fragment.
179 #undef JEMALLOC_MAPS_COALESCE
182 * If defined, use munmap() to unmap freed chunks, rather than storing them for
183 * later reuse. This is disabled by default on Linux because common sequences
184 * of mmap()/munmap() calls will cause virtual memory map holes.
186 #undef JEMALLOC_MUNMAP
188 /* TLS is used to map arenas and magazine caches to threads. */
192 * ffs*() functions to use for bitmapping. Don't use these directly; instead,
193 * use ffs_*() from util.h.
195 #undef JEMALLOC_INTERNAL_FFSLL
196 #undef JEMALLOC_INTERNAL_FFSL
197 #undef JEMALLOC_INTERNAL_FFS
200 * JEMALLOC_IVSALLOC enables ivsalloc(), which verifies that pointers reside
201 * within jemalloc-owned chunks before dereferencing them.
203 #undef JEMALLOC_IVSALLOC
206 * If defined, explicitly attempt to more uniformly distribute large allocation
207 * pointer alignments across all cache indices.
209 #undef JEMALLOC_CACHE_OBLIVIOUS
212 * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings.
215 #undef JEMALLOC_ZONE_VERSION
218 * Methods for purging unused pages differ between operating systems.
220 * madvise(..., MADV_DONTNEED) : On Linux, this immediately discards pages,
221 * such that new pages will be demand-zeroed if
222 * the address region is later touched.
223 * madvise(..., MADV_FREE) : On FreeBSD and Darwin, this marks pages as being
224 * unused, such that they will be discarded rather
227 #undef JEMALLOC_PURGE_MADVISE_DONTNEED
228 #undef JEMALLOC_PURGE_MADVISE_FREE
230 /* Define if operating system has alloca.h header. */
231 #undef JEMALLOC_HAS_ALLOCA_H
233 /* C99 restrict keyword supported. */
234 #undef JEMALLOC_HAS_RESTRICT
236 /* For use by hash code. */
237 #undef JEMALLOC_BIG_ENDIAN
239 /* sizeof(int) == 2^LG_SIZEOF_INT. */
242 /* sizeof(long) == 2^LG_SIZEOF_LONG. */
243 #undef LG_SIZEOF_LONG
245 /* sizeof(long long) == 2^LG_SIZEOF_LONG_LONG. */
246 #undef LG_SIZEOF_LONG_LONG
248 /* sizeof(intmax_t) == 2^LG_SIZEOF_INTMAX_T. */
249 #undef LG_SIZEOF_INTMAX_T
251 /* glibc malloc hooks (__malloc_hook, __realloc_hook, __free_hook). */
252 #undef JEMALLOC_GLIBC_MALLOC_HOOK
254 /* glibc memalign hook. */
255 #undef JEMALLOC_GLIBC_MEMALIGN_HOOK
257 /* Adaptive mutex support in pthreads. */
258 #undef JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP
261 * If defined, jemalloc symbols are not exported (doesn't work when
262 * JEMALLOC_PREFIX is not defined).
264 #undef JEMALLOC_EXPORT
266 /* config.malloc_conf options string. */
267 #undef JEMALLOC_CONFIG_MALLOC_CONF
269 #endif /* JEMALLOC_INTERNAL_DEFS_H_ */