jemalloc_defs.h.in revision 83c324acd8bd5f32e0ce9b4d3df2f1a0ae46f487
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 * 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. 13 */ 14#undef je_malloc_conf 15#undef je_malloc_message 16#undef je_malloc 17#undef je_calloc 18#undef je_posix_memalign 19#undef je_aligned_alloc 20#undef je_realloc 21#undef je_free 22#undef je_malloc_usable_size 23#undef je_malloc_stats_print 24#undef je_mallctl 25#undef je_mallctlnametomib 26#undef je_mallctlbymib 27#undef je_memalign 28#undef je_valloc 29#undef je_allocm 30#undef je_rallocm 31#undef je_sallocm 32#undef je_dallocm 33#undef je_nallocm 34 35/* 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 39 * possibility. 40 */ 41#undef JEMALLOC_PRIVATE_NAMESPACE 42#undef JEMALLOC_N 43 44/* 45 * Hyper-threaded CPUs may need a special instruction inside spin loops in 46 * order to yield to another virtual CPU. 47 */ 48#undef CPU_SPINWAIT 49 50/* 51 * Defined if OSAtomic*() functions are available, as provided by Darwin, and 52 * documented in the atomic(3) manual page. 53 */ 54#undef JEMALLOC_OSATOMIC 55 56/* 57 * Defined if __sync_add_and_fetch(uint32_t *, uint32_t) and 58 * __sync_sub_and_fetch(uint32_t *, uint32_t) are available, despite 59 * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 not being defined (which means the 60 * functions are defined in libgcc instead of being inlines) 61 */ 62#undef JE_FORCE_SYNC_COMPARE_AND_SWAP_4 63 64/* 65 * Defined if __sync_add_and_fetch(uint64_t *, uint64_t) and 66 * __sync_sub_and_fetch(uint64_t *, uint64_t) are available, despite 67 * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 not being defined (which means the 68 * functions are defined in libgcc instead of being inlines) 69 */ 70#undef JE_FORCE_SYNC_COMPARE_AND_SWAP_8 71 72/* 73 * Defined if OSSpin*() functions are available, as provided by Darwin, and 74 * documented in the spinlock(3) manual page. 75 */ 76#undef JEMALLOC_OSSPIN 77 78/* 79 * Defined if _malloc_thread_cleanup() exists. At least in the case of 80 * FreeBSD, pthread_key_create() allocates, which if used during malloc 81 * bootstrapping will cause recursion into the pthreads library. Therefore, if 82 * _malloc_thread_cleanup() exists, use it as the basis for thread cleanup in 83 * malloc_tsd. 84 */ 85#undef JEMALLOC_MALLOC_THREAD_CLEANUP 86 87/* 88 * Defined if threaded initialization is known to be safe on this platform. 89 * Among other things, it must be possible to initialize a mutex without 90 * triggering allocation in order for threaded allocation to be safe. 91 */ 92#undef JEMALLOC_THREADED_INIT 93 94/* 95 * Defined if the pthreads implementation defines 96 * _pthread_mutex_init_calloc_cb(), in which case the function is used in order 97 * to avoid recursive allocation during mutex initialization. 98 */ 99#undef JEMALLOC_MUTEX_INIT_CB 100 101/* Defined if __attribute__((...)) syntax is supported. */ 102#undef JEMALLOC_HAVE_ATTR 103#ifdef JEMALLOC_HAVE_ATTR 104# define JEMALLOC_CATTR(s, a) __attribute__((s)) 105# define JEMALLOC_ATTR(s) JEMALLOC_CATTR(s,) 106#else 107# define JEMALLOC_CATTR(s, a) a 108# define JEMALLOC_ATTR(s) JEMALLOC_CATTR(s,) 109#endif 110 111/* Defined if sbrk() is supported. */ 112#undef JEMALLOC_HAVE_SBRK 113 114/* Non-empty if the tls_model attribute is supported. */ 115#undef JEMALLOC_TLS_MODEL 116 117/* JEMALLOC_CC_SILENCE enables code that silences unuseful compiler warnings. */ 118#undef JEMALLOC_CC_SILENCE 119 120/* 121 * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables 122 * inline functions. 123 */ 124#undef JEMALLOC_DEBUG 125 126/* JEMALLOC_STATS enables statistics calculation. */ 127#undef JEMALLOC_STATS 128 129/* JEMALLOC_PROF enables allocation profiling. */ 130#undef JEMALLOC_PROF 131 132/* Use libunwind for profile backtracing if defined. */ 133#undef JEMALLOC_PROF_LIBUNWIND 134 135/* Use libgcc for profile backtracing if defined. */ 136#undef JEMALLOC_PROF_LIBGCC 137 138/* Use gcc intrinsics for profile backtracing if defined. */ 139#undef JEMALLOC_PROF_GCC 140 141/* 142 * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects. 143 * This makes it possible to allocate/deallocate objects without any locking 144 * when the cache is in the steady state. 145 */ 146#undef JEMALLOC_TCACHE 147 148/* 149 * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage 150 * segment (DSS). 151 */ 152#undef JEMALLOC_DSS 153 154/* Support memory filling (junk/zero/quarantine/redzone). */ 155#undef JEMALLOC_FILL 156 157/* Support the experimental API. */ 158#undef JEMALLOC_EXPERIMENTAL 159 160/* Support utrace(2)-based tracing. */ 161#undef JEMALLOC_UTRACE 162 163/* Support Valgrind. */ 164#undef JEMALLOC_VALGRIND 165 166/* Support optional abort() on OOM. */ 167#undef JEMALLOC_XMALLOC 168 169/* Support lazy locking (avoid locking unless a second thread is launched). */ 170#undef JEMALLOC_LAZY_LOCK 171 172/* One page is 2^STATIC_PAGE_SHIFT bytes. */ 173#undef STATIC_PAGE_SHIFT 174 175/* TLS is used to map arenas and magazine caches to threads. */ 176#undef JEMALLOC_TLS 177 178/* 179 * JEMALLOC_IVSALLOC enables ivsalloc(), which verifies that pointers reside 180 * within jemalloc-owned chunks before dereferencing them. 181 */ 182#undef JEMALLOC_IVSALLOC 183 184/* 185 * Define overrides for non-standard allocator-related functions if they 186 * are present on the system. 187 */ 188#undef JEMALLOC_OVERRIDE_MEMALIGN 189#undef JEMALLOC_OVERRIDE_VALLOC 190 191/* 192 * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings. 193 */ 194#undef JEMALLOC_ZONE 195#undef JEMALLOC_ZONE_VERSION 196 197/* If defined, use mremap(...MREMAP_FIXED...) for huge realloc(). */ 198#undef JEMALLOC_MREMAP_FIXED 199 200/* 201 * Methods for purging unused pages differ between operating systems. 202 * 203 * madvise(..., MADV_DONTNEED) : On Linux, this immediately discards pages, 204 * such that new pages will be demand-zeroed if 205 * the address region is later touched. 206 * madvise(..., MADV_FREE) : On FreeBSD and Darwin, this marks pages as being 207 * unused, such that they will be discarded rather 208 * than swapped out. 209 */ 210#undef JEMALLOC_PURGE_MADVISE_DONTNEED 211#undef JEMALLOC_PURGE_MADVISE_FREE 212 213/* sizeof(void *) == 2^LG_SIZEOF_PTR. */ 214#undef LG_SIZEOF_PTR 215 216/* sizeof(int) == 2^LG_SIZEOF_INT. */ 217#undef LG_SIZEOF_INT 218 219/* sizeof(long) == 2^LG_SIZEOF_LONG. */ 220#undef LG_SIZEOF_LONG 221 222/* sizeof(intmax_t) == 2^LG_SIZEOF_INTMAX_T. */ 223#undef LG_SIZEOF_INTMAX_T 224