]>
git.saurik.com Git - redis.git/blob - deps/jemalloc/include/jemalloc/jemalloc_defs.h.in
c469142a5d451764df9c3cac5753deb9bd85cf23
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.
7 #undef JEMALLOC_CPREFIX
10 * Name mangling for public symbols is controlled by --with-mangling and
11 * --with-jemalloc-prefix. With default settings the je_ prefix is stripped by
12 * these macro definitions.
15 #undef je_malloc_message
18 #undef je_posix_memalign
19 #undef je_aligned_alloc
22 #undef je_malloc_usable_size
23 #undef je_malloc_stats_print
25 #undef je_mallctlnametomib
26 #undef je_mallctlbymib
36 * JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs.
37 * For shared libraries, symbol visibility mechanisms prevent these symbols
38 * from being exported, but for static libraries, naming collisions are a real
41 #undef JEMALLOC_PRIVATE_NAMESPACE
45 * Hyper-threaded CPUs may need a special instruction inside spin loops in
46 * order to yield to another virtual CPU.
50 /* Defined if the equivalent of FreeBSD's atomic(9) functions are available. */
51 #undef JEMALLOC_ATOMIC9
54 * Defined if OSAtomic*() functions are available, as provided by Darwin, and
55 * documented in the atomic(3) manual page.
57 #undef JEMALLOC_OSATOMIC
60 * Defined if __sync_add_and_fetch(uint32_t *, uint32_t) and
61 * __sync_sub_and_fetch(uint32_t *, uint32_t) are available, despite
62 * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 not being defined (which means the
63 * functions are defined in libgcc instead of being inlines)
65 #undef JE_FORCE_SYNC_COMPARE_AND_SWAP_4
68 * Defined if __sync_add_and_fetch(uint64_t *, uint64_t) and
69 * __sync_sub_and_fetch(uint64_t *, uint64_t) are available, despite
70 * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 not being defined (which means the
71 * functions are defined in libgcc instead of being inlines)
73 #undef JE_FORCE_SYNC_COMPARE_AND_SWAP_8
76 * Defined if OSSpin*() functions are available, as provided by Darwin, and
77 * documented in the spinlock(3) manual page.
79 #undef JEMALLOC_OSSPIN
82 * Defined if _malloc_thread_cleanup() exists. At least in the case of
83 * FreeBSD, pthread_key_create() allocates, which if used during malloc
84 * bootstrapping will cause recursion into the pthreads library. Therefore, if
85 * _malloc_thread_cleanup() exists, use it as the basis for thread cleanup in
88 #undef JEMALLOC_MALLOC_THREAD_CLEANUP
91 * Defined if threaded initialization is known to be safe on this platform.
92 * Among other things, it must be possible to initialize a mutex without
93 * triggering allocation in order for threaded allocation to be safe.
95 #undef JEMALLOC_THREADED_INIT
98 * Defined if the pthreads implementation defines
99 * _pthread_mutex_init_calloc_cb(), in which case the function is used in order
100 * to avoid recursive allocation during mutex initialization.
102 #undef JEMALLOC_MUTEX_INIT_CB
104 /* Defined if __attribute__((...)) syntax is supported. */
105 #undef JEMALLOC_HAVE_ATTR
106 #ifdef JEMALLOC_HAVE_ATTR
107 # define JEMALLOC_ATTR(s) __attribute__((s))
108 # define JEMALLOC_EXPORT JEMALLOC_ATTR(visibility("default"))
109 # define JEMALLOC_ALIGNED(s) JEMALLOC_ATTR(aligned(s))
110 # define JEMALLOC_SECTION(s) JEMALLOC_ATTR(section(s))
111 # define JEMALLOC_NOINLINE JEMALLOC_ATTR(noinline)
113 # define JEMALLOC_ATTR(s)
115 # define JEMALLOC_EXPORT __declspec(dllexport)
117 # define JEMALLOC_EXPORT __declspec(dllimport)
119 # define JEMALLOC_ALIGNED(s) __declspec(align(s))
120 # define JEMALLOC_SECTION(s) __declspec(allocate(s))
121 # define JEMALLOC_NOINLINE __declspec(noinline)
123 # define JEMALLOC_ATTR(s)
124 # define JEMALLOC_EXPORT
125 # define JEMALLOC_ALIGNED(s)
126 # define JEMALLOC_SECTION(s)
127 # define JEMALLOC_NOINLINE
130 /* Defined if sbrk() is supported. */
131 #undef JEMALLOC_HAVE_SBRK
133 /* Non-empty if the tls_model attribute is supported. */
134 #undef JEMALLOC_TLS_MODEL
136 /* JEMALLOC_CC_SILENCE enables code that silences unuseful compiler warnings. */
137 #undef JEMALLOC_CC_SILENCE
140 * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
143 #undef JEMALLOC_DEBUG
145 /* JEMALLOC_STATS enables statistics calculation. */
146 #undef JEMALLOC_STATS
148 /* JEMALLOC_PROF enables allocation profiling. */
151 /* Use libunwind for profile backtracing if defined. */
152 #undef JEMALLOC_PROF_LIBUNWIND
154 /* Use libgcc for profile backtracing if defined. */
155 #undef JEMALLOC_PROF_LIBGCC
157 /* Use gcc intrinsics for profile backtracing if defined. */
158 #undef JEMALLOC_PROF_GCC
161 * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects.
162 * This makes it possible to allocate/deallocate objects without any locking
163 * when the cache is in the steady state.
165 #undef JEMALLOC_TCACHE
168 * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage
173 /* Support memory filling (junk/zero/quarantine/redzone). */
176 /* Support the experimental API. */
177 #undef JEMALLOC_EXPERIMENTAL
179 /* Support utrace(2)-based tracing. */
180 #undef JEMALLOC_UTRACE
182 /* Support Valgrind. */
183 #undef JEMALLOC_VALGRIND
185 /* Support optional abort() on OOM. */
186 #undef JEMALLOC_XMALLOC
188 /* Support lazy locking (avoid locking unless a second thread is launched). */
189 #undef JEMALLOC_LAZY_LOCK
191 /* One page is 2^STATIC_PAGE_SHIFT bytes. */
192 #undef STATIC_PAGE_SHIFT
195 * If defined, use munmap() to unmap freed chunks, rather than storing them for
196 * later reuse. This is disabled by default on Linux because common sequences
197 * of mmap()/munmap() calls will cause virtual memory map holes.
199 #undef JEMALLOC_MUNMAP
202 * If defined, use mremap(...MREMAP_FIXED...) for huge realloc(). This is
203 * disabled by default because it is Linux-specific and it will cause virtual
204 * memory map holes, much like munmap(2) does.
206 #undef JEMALLOC_MREMAP
208 /* TLS is used to map arenas and magazine caches to threads. */
212 * JEMALLOC_IVSALLOC enables ivsalloc(), which verifies that pointers reside
213 * within jemalloc-owned chunks before dereferencing them.
215 #undef JEMALLOC_IVSALLOC
218 * Define overrides for non-standard allocator-related functions if they
219 * are present on the system.
221 #undef JEMALLOC_OVERRIDE_MEMALIGN
222 #undef JEMALLOC_OVERRIDE_VALLOC
225 * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings.
228 #undef JEMALLOC_ZONE_VERSION
231 * Methods for purging unused pages differ between operating systems.
233 * madvise(..., MADV_DONTNEED) : On Linux, this immediately discards pages,
234 * such that new pages will be demand-zeroed if
235 * the address region is later touched.
236 * madvise(..., MADV_FREE) : On FreeBSD and Darwin, this marks pages as being
237 * unused, such that they will be discarded rather
240 #undef JEMALLOC_PURGE_MADVISE_DONTNEED
241 #undef JEMALLOC_PURGE_MADVISE_FREE
243 /* sizeof(void *) == 2^LG_SIZEOF_PTR. */
246 /* sizeof(int) == 2^LG_SIZEOF_INT. */
249 /* sizeof(long) == 2^LG_SIZEOF_LONG. */
250 #undef LG_SIZEOF_LONG
252 /* sizeof(intmax_t) == 2^LG_SIZEOF_INTMAX_T. */
253 #undef LG_SIZEOF_INTMAX_T