]>
git.saurik.com Git - redis.git/blob - deps/jemalloc/include/jemalloc/jemalloc_defs.h.in
9ac7e1c20768839c80de0347a5612c37f085e01b
1 #ifndef JEMALLOC_DEFS_H_
2 #define JEMALLOC_DEFS_H_
5 * If JEMALLOC_PREFIX is defined, it will cause all public APIs to be prefixed.
6 * This makes it possible, with some care, to use multiple allocators
9 * In many cases it is more convenient to manually prefix allocator function
10 * calls than to let macros do it automatically, particularly when using
11 * multiple allocators simultaneously. Define JEMALLOC_MANGLE before
12 * #include'ing jemalloc.h in order to cause name mangling that corresponds to
15 #undef JEMALLOC_PREFIX
16 #undef JEMALLOC_CPREFIX
17 #if (defined(JEMALLOC_PREFIX) && defined(JEMALLOC_MANGLE))
22 * JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs.
23 * For shared libraries, symbol visibility mechanisms prevent these symbols
24 * from being exported, but for static libraries, naming collisions are a real
27 #undef JEMALLOC_PRIVATE_NAMESPACE
31 * Hyper-threaded CPUs may need a special instruction inside spin loops in
32 * order to yield to another virtual CPU.
37 * Defined if OSAtomic*() functions are available, as provided by Darwin, and
38 * documented in the atomic(3) manual page.
40 #undef JEMALLOC_OSATOMIC
43 * Defined if OSSpin*() functions are available, as provided by Darwin, and
44 * documented in the spinlock(3) manual page.
46 #undef JEMALLOC_OSSPIN
48 /* Defined if __attribute__((...)) syntax is supported. */
49 #undef JEMALLOC_HAVE_ATTR
50 #ifdef JEMALLOC_HAVE_ATTR
51 # define JEMALLOC_ATTR(s) __attribute__((s))
53 # define JEMALLOC_ATTR(s)
56 /* JEMALLOC_CC_SILENCE enables code that silences unuseful compiler warnings. */
57 #undef JEMALLOC_CC_SILENCE
60 * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
65 /* JEMALLOC_STATS enables statistics calculation. */
68 /* JEMALLOC_PROF enables allocation profiling. */
71 /* Use libunwind for profile backtracing if defined. */
72 #undef JEMALLOC_PROF_LIBUNWIND
74 /* Use libgcc for profile backtracing if defined. */
75 #undef JEMALLOC_PROF_LIBGCC
77 /* Use gcc intrinsics for profile backtracing if defined. */
78 #undef JEMALLOC_PROF_GCC
81 * JEMALLOC_TINY enables support for tiny objects, which are smaller than one
87 * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects.
88 * This makes it possible to allocate/deallocate objects without any locking
89 * when the cache is in the steady state.
91 #undef JEMALLOC_TCACHE
94 * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage
99 /* JEMALLOC_SWAP enables mmap()ed swap file support. */
102 /* Support memory filling (junk/zero). */
105 /* Support optional abort() on OOM. */
106 #undef JEMALLOC_XMALLOC
108 /* Support SYSV semantics. */
111 /* Support lazy locking (avoid locking unless a second thread is launched). */
112 #undef JEMALLOC_LAZY_LOCK
114 /* Determine page size at run time if defined. */
115 #undef DYNAMIC_PAGE_SHIFT
117 /* One page is 2^STATIC_PAGE_SHIFT bytes. */
118 #undef STATIC_PAGE_SHIFT
120 /* TLS is used to map arenas and magazine caches to threads. */
124 * JEMALLOC_IVSALLOC enables ivsalloc(), which verifies that pointers reside
125 * within jemalloc-owned chunks before dereferencing them.
127 #undef JEMALLOC_IVSALLOC
130 * Define overrides for non-standard allocator-related functions if they
131 * are present on the system.
133 #undef JEMALLOC_OVERRIDE_MEMALIGN
134 #undef JEMALLOC_OVERRIDE_VALLOC
137 * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings.
140 #undef JEMALLOC_ZONE_VERSION
142 /* If defined, use mremap(...MREMAP_FIXED...) for huge realloc(). */
143 #undef JEMALLOC_MREMAP_FIXED
146 * Methods for purging unused pages differ between operating systems.
148 * madvise(..., MADV_DONTNEED) : On Linux, this immediately discards pages,
149 * such that new pages will be demand-zeroed if
150 * the address region is later touched.
151 * madvise(..., MADV_FREE) : On FreeBSD and Darwin, this marks pages as being
152 * unused, such that they will be discarded rather
155 #undef JEMALLOC_PURGE_MADVISE_DONTNEED
156 #undef JEMALLOC_PURGE_MADVISE_FREE
158 /* sizeof(void *) == 2^LG_SIZEOF_PTR. */
161 /* sizeof(int) == 2^LG_SIZEOF_INT. */
164 /* sizeof(long) == 2^LG_SIZEOF_LONG. */
165 #undef LG_SIZEOF_LONG
167 #endif /* JEMALLOC_DEFS_H_ */