jemalloc_defs.h.in revision 3cc1f1aa6981d6647aa01cec725fb2c134c1b0e9
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/* Non-empty if the tls_model attribute is supported. */ 112#undef JEMALLOC_TLS_MODEL 113 114/* JEMALLOC_CC_SILENCE enables code that silences unuseful compiler warnings. */ 115#undef JEMALLOC_CC_SILENCE 116 117/* 118 * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables 119 * inline functions. 120 */ 121#undef JEMALLOC_DEBUG 122 123/* JEMALLOC_STATS enables statistics calculation. */ 124#undef JEMALLOC_STATS 125 126/* JEMALLOC_PROF enables allocation profiling. */ 127#undef JEMALLOC_PROF 128 129/* Use libunwind for profile backtracing if defined. */ 130#undef JEMALLOC_PROF_LIBUNWIND 131 132/* Use libgcc for profile backtracing if defined. */ 133#undef JEMALLOC_PROF_LIBGCC 134 135/* Use gcc intrinsics for profile backtracing if defined. */ 136#undef JEMALLOC_PROF_GCC 137 138/* 139 * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects. 140 * This makes it possible to allocate/deallocate objects without any locking 141 * when the cache is in the steady state. 142 */ 143#undef JEMALLOC_TCACHE 144 145/* 146 * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage 147 * segment (DSS). 148 */ 149#undef JEMALLOC_DSS 150 151/* Support memory filling (junk/zero). */ 152#undef JEMALLOC_FILL 153 154/* Support the experimental API. */ 155#undef JEMALLOC_EXPERIMENTAL 156 157/* Support optional abort() on OOM. */ 158#undef JEMALLOC_XMALLOC 159 160/* Support lazy locking (avoid locking unless a second thread is launched). */ 161#undef JEMALLOC_LAZY_LOCK 162 163/* One page is 2^STATIC_PAGE_SHIFT bytes. */ 164#undef STATIC_PAGE_SHIFT 165 166/* TLS is used to map arenas and magazine caches to threads. */ 167#undef JEMALLOC_TLS 168 169/* 170 * JEMALLOC_IVSALLOC enables ivsalloc(), which verifies that pointers reside 171 * within jemalloc-owned chunks before dereferencing them. 172 */ 173#undef JEMALLOC_IVSALLOC 174 175/* 176 * Define overrides for non-standard allocator-related functions if they 177 * are present on the system. 178 */ 179#undef JEMALLOC_OVERRIDE_MEMALIGN 180#undef JEMALLOC_OVERRIDE_VALLOC 181 182/* 183 * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings. 184 */ 185#undef JEMALLOC_ZONE 186#undef JEMALLOC_ZONE_VERSION 187 188/* If defined, use mremap(...MREMAP_FIXED...) for huge realloc(). */ 189#undef JEMALLOC_MREMAP_FIXED 190 191/* 192 * Methods for purging unused pages differ between operating systems. 193 * 194 * madvise(..., MADV_DONTNEED) : On Linux, this immediately discards pages, 195 * such that new pages will be demand-zeroed if 196 * the address region is later touched. 197 * madvise(..., MADV_FREE) : On FreeBSD and Darwin, this marks pages as being 198 * unused, such that they will be discarded rather 199 * than swapped out. 200 */ 201#undef JEMALLOC_PURGE_MADVISE_DONTNEED 202#undef JEMALLOC_PURGE_MADVISE_FREE 203 204/* sizeof(void *) == 2^LG_SIZEOF_PTR. */ 205#undef LG_SIZEOF_PTR 206 207/* sizeof(int) == 2^LG_SIZEOF_INT. */ 208#undef LG_SIZEOF_INT 209 210/* sizeof(long) == 2^LG_SIZEOF_LONG. */ 211#undef LG_SIZEOF_LONG 212 213/* sizeof(intmax_t) == 2^LG_SIZEOF_INTMAX_T. */ 214#undef LG_SIZEOF_INTMAX_T 215