]>
git.saurik.com Git - redis.git/blob - deps/jemalloc/include/jemalloc/jemalloc_defs.h.in
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 * Hyper-threaded CPUs may need a special instruction inside spin loops in
23 * order to yield to another virtual CPU.
28 * Defined if OSAtomic*() functions are available, as provided by Darwin, and
29 * documented in the atomic(3) manual page.
31 #undef JEMALLOC_OSATOMIC
34 * Defined if OSSpin*() functions are available, as provided by Darwin, and
35 * documented in the spinlock(3) manual page.
37 #undef JEMALLOC_OSSPIN
39 /* Defined if __attribute__((...)) syntax is supported. */
40 #undef JEMALLOC_HAVE_ATTR
41 #ifdef JEMALLOC_HAVE_ATTR
42 # define JEMALLOC_ATTR(s) __attribute__((s))
44 # define JEMALLOC_ATTR(s)
47 /* JEMALLOC_CC_SILENCE enables code that silences unuseful compiler warnings. */
48 #undef JEMALLOC_CC_SILENCE
51 * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
56 /* JEMALLOC_STATS enables statistics calculation. */
59 /* JEMALLOC_PROF enables allocation profiling. */
62 /* Use libunwind for profile backtracing if defined. */
63 #undef JEMALLOC_PROF_LIBUNWIND
65 /* Use libgcc for profile backtracing if defined. */
66 #undef JEMALLOC_PROF_LIBGCC
68 /* Use gcc intrinsics for profile backtracing if defined. */
69 #undef JEMALLOC_PROF_GCC
72 * JEMALLOC_TINY enables support for tiny objects, which are smaller than one
78 * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects.
79 * This makes it possible to allocate/deallocate objects without any locking
80 * when the cache is in the steady state.
82 #undef JEMALLOC_TCACHE
85 * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage
90 /* JEMALLOC_SWAP enables mmap()ed swap file support. */
93 /* Support memory filling (junk/zero). */
96 /* Support optional abort() on OOM. */
97 #undef JEMALLOC_XMALLOC
99 /* Support SYSV semantics. */
102 /* Support lazy locking (avoid locking unless a second thread is launched). */
103 #undef JEMALLOC_LAZY_LOCK
105 /* Determine page size at run time if defined. */
106 #undef DYNAMIC_PAGE_SHIFT
108 /* One page is 2^STATIC_PAGE_SHIFT bytes. */
109 #undef STATIC_PAGE_SHIFT
111 /* TLS is used to map arenas and magazine caches to threads. */
115 * JEMALLOC_IVSALLOC enables ivsalloc(), which verifies that pointers reside
116 * within jemalloc-owned chunks before dereferencing them.
118 #undef JEMALLOC_IVSALLOC
121 * Define overrides for non-standard allocator-related functions if they
122 * are present on the system.
124 #undef JEMALLOC_OVERRIDE_MEMALIGN
125 #undef JEMALLOC_OVERRIDE_VALLOC
128 * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings.
131 #undef JEMALLOC_ZONE_VERSION
133 /* If defined, use mremap(...MREMAP_FIXED...) for huge realloc(). */
134 #undef JEMALLOC_MREMAP_FIXED
137 * Methods for purging unused pages differ between operating systems.
139 * madvise(..., MADV_DONTNEED) : On Linux, this immediately discards pages,
140 * such that new pages will be demand-zeroed if
141 * the address region is later touched.
142 * madvise(..., MADV_FREE) : On FreeBSD and Darwin, this marks pages as being
143 * unused, such that they will be discarded rather
146 #undef JEMALLOC_PURGE_MADVISE_DONTNEED
147 #undef JEMALLOC_PURGE_MADVISE_FREE
149 /* sizeof(void *) == 2^LG_SIZEOF_PTR. */
152 /* sizeof(int) == 2^LG_SIZEOF_INT. */
155 /* sizeof(long) == 2^LG_SIZEOF_LONG. */
156 #undef LG_SIZEOF_LONG
158 #endif /* JEMALLOC_DEFS_H_ */