]> git.saurik.com Git - redis.git/blob - deps/jemalloc/include/jemalloc/jemalloc_defs.h.in
9ac7e1c20768839c80de0347a5612c37f085e01b
[redis.git] / deps / jemalloc / include / jemalloc / jemalloc_defs.h.in
1 #ifndef JEMALLOC_DEFS_H_
2 #define JEMALLOC_DEFS_H_
3
4 /*
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
7 * simultaneously.
8 *
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
13 * the API prefixing.
14 */
15 #undef JEMALLOC_PREFIX
16 #undef JEMALLOC_CPREFIX
17 #if (defined(JEMALLOC_PREFIX) && defined(JEMALLOC_MANGLE))
18 #undef JEMALLOC_P
19 #endif
20
21 /*
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
25 * possibility.
26 */
27 #undef JEMALLOC_PRIVATE_NAMESPACE
28 #undef JEMALLOC_N
29
30 /*
31 * Hyper-threaded CPUs may need a special instruction inside spin loops in
32 * order to yield to another virtual CPU.
33 */
34 #undef CPU_SPINWAIT
35
36 /*
37 * Defined if OSAtomic*() functions are available, as provided by Darwin, and
38 * documented in the atomic(3) manual page.
39 */
40 #undef JEMALLOC_OSATOMIC
41
42 /*
43 * Defined if OSSpin*() functions are available, as provided by Darwin, and
44 * documented in the spinlock(3) manual page.
45 */
46 #undef JEMALLOC_OSSPIN
47
48 /* Defined if __attribute__((...)) syntax is supported. */
49 #undef JEMALLOC_HAVE_ATTR
50 #ifdef JEMALLOC_HAVE_ATTR
51 # define JEMALLOC_ATTR(s) __attribute__((s))
52 #else
53 # define JEMALLOC_ATTR(s)
54 #endif
55
56 /* JEMALLOC_CC_SILENCE enables code that silences unuseful compiler warnings. */
57 #undef JEMALLOC_CC_SILENCE
58
59 /*
60 * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
61 * inline functions.
62 */
63 #undef JEMALLOC_DEBUG
64
65 /* JEMALLOC_STATS enables statistics calculation. */
66 #undef JEMALLOC_STATS
67
68 /* JEMALLOC_PROF enables allocation profiling. */
69 #undef JEMALLOC_PROF
70
71 /* Use libunwind for profile backtracing if defined. */
72 #undef JEMALLOC_PROF_LIBUNWIND
73
74 /* Use libgcc for profile backtracing if defined. */
75 #undef JEMALLOC_PROF_LIBGCC
76
77 /* Use gcc intrinsics for profile backtracing if defined. */
78 #undef JEMALLOC_PROF_GCC
79
80 /*
81 * JEMALLOC_TINY enables support for tiny objects, which are smaller than one
82 * quantum.
83 */
84 #undef JEMALLOC_TINY
85
86 /*
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.
90 */
91 #undef JEMALLOC_TCACHE
92
93 /*
94 * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage
95 * segment (DSS).
96 */
97 #undef JEMALLOC_DSS
98
99 /* JEMALLOC_SWAP enables mmap()ed swap file support. */
100 #undef JEMALLOC_SWAP
101
102 /* Support memory filling (junk/zero). */
103 #undef JEMALLOC_FILL
104
105 /* Support optional abort() on OOM. */
106 #undef JEMALLOC_XMALLOC
107
108 /* Support SYSV semantics. */
109 #undef JEMALLOC_SYSV
110
111 /* Support lazy locking (avoid locking unless a second thread is launched). */
112 #undef JEMALLOC_LAZY_LOCK
113
114 /* Determine page size at run time if defined. */
115 #undef DYNAMIC_PAGE_SHIFT
116
117 /* One page is 2^STATIC_PAGE_SHIFT bytes. */
118 #undef STATIC_PAGE_SHIFT
119
120 /* TLS is used to map arenas and magazine caches to threads. */
121 #undef NO_TLS
122
123 /*
124 * JEMALLOC_IVSALLOC enables ivsalloc(), which verifies that pointers reside
125 * within jemalloc-owned chunks before dereferencing them.
126 */
127 #undef JEMALLOC_IVSALLOC
128
129 /*
130 * Define overrides for non-standard allocator-related functions if they
131 * are present on the system.
132 */
133 #undef JEMALLOC_OVERRIDE_MEMALIGN
134 #undef JEMALLOC_OVERRIDE_VALLOC
135
136 /*
137 * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings.
138 */
139 #undef JEMALLOC_ZONE
140 #undef JEMALLOC_ZONE_VERSION
141
142 /* If defined, use mremap(...MREMAP_FIXED...) for huge realloc(). */
143 #undef JEMALLOC_MREMAP_FIXED
144
145 /*
146 * Methods for purging unused pages differ between operating systems.
147 *
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
153 * than swapped out.
154 */
155 #undef JEMALLOC_PURGE_MADVISE_DONTNEED
156 #undef JEMALLOC_PURGE_MADVISE_FREE
157
158 /* sizeof(void *) == 2^LG_SIZEOF_PTR. */
159 #undef LG_SIZEOF_PTR
160
161 /* sizeof(int) == 2^LG_SIZEOF_INT. */
162 #undef LG_SIZEOF_INT
163
164 /* sizeof(long) == 2^LG_SIZEOF_LONG. */
165 #undef LG_SIZEOF_LONG
166
167 #endif /* JEMALLOC_DEFS_H_ */