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