|
1 | 1 | /* include/jemalloc/internal/jemalloc_internal_defs.h. Generated from jemalloc_internal_defs.h.in by configure. */ |
2 | 2 | #ifndef JEMALLOC_INTERNAL_DEFS_H_ |
3 | 3 | #define JEMALLOC_INTERNAL_DEFS_H_ |
4 | | - |
5 | | - |
6 | | -#ifndef _GNU_SOURCE |
7 | | - #define _GNU_SOURCE |
8 | | -#endif |
9 | | - |
10 | 4 | /* |
11 | 5 | * If JEMALLOC_PREFIX is defined via --with-jemalloc-prefix, it will cause all |
12 | 6 | * public APIs to be prefixed. This makes it possible, with some care, to use |
|
25 | 19 | #define JEMALLOC_OVERRIDE___LIBC_MEMALIGN |
26 | 20 | #define JEMALLOC_OVERRIDE___LIBC_REALLOC |
27 | 21 | #define JEMALLOC_OVERRIDE___LIBC_VALLOC |
28 | | -#define JEMALLOC_OVERRIDE___POSIX_MEMALIGN |
| 22 | +/* #undef JEMALLOC_OVERRIDE___POSIX_MEMALIGN */ |
29 | 23 |
|
30 | 24 | /* |
31 | 25 | * JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs. |
|
39 | 33 | * Hyper-threaded CPUs may need a special instruction inside spin loops in |
40 | 34 | * order to yield to another virtual CPU. |
41 | 35 | */ |
42 | | -#define CPU_SPINWAIT |
| 36 | +#define CPU_SPINWAIT __asm__ volatile("pause") |
43 | 37 | /* 1 if CPU_SPINWAIT is defined, 0 otherwise. */ |
44 | | -#define HAVE_CPU_SPINWAIT 0 |
| 38 | +#define HAVE_CPU_SPINWAIT 1 |
45 | 39 |
|
46 | 40 | /* |
47 | 41 | * Number of significant bits in virtual addresses. This may be less than the |
|
55 | 49 |
|
56 | 50 | /* Defined if GCC __atomic atomics are available. */ |
57 | 51 | #define JEMALLOC_GCC_ATOMIC_ATOMICS 1 |
| 52 | +/* and the 8-bit variant support. */ |
| 53 | +#define JEMALLOC_GCC_U8_ATOMIC_ATOMICS 1 |
58 | 54 |
|
59 | 55 | /* Defined if GCC __sync atomics are available. */ |
60 | 56 | #define JEMALLOC_GCC_SYNC_ATOMICS 1 |
61 | | - |
62 | | -/* |
63 | | - * Defined if __sync_add_and_fetch(uint32_t *, uint32_t) and |
64 | | - * __sync_sub_and_fetch(uint32_t *, uint32_t) are available, despite |
65 | | - * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 not being defined (which means the |
66 | | - * functions are defined in libgcc instead of being inlines). |
67 | | - */ |
68 | | -/* #undef JE_FORCE_SYNC_COMPARE_AND_SWAP_4 */ |
69 | | - |
70 | | -/* |
71 | | - * Defined if __sync_add_and_fetch(uint64_t *, uint64_t) and |
72 | | - * __sync_sub_and_fetch(uint64_t *, uint64_t) are available, despite |
73 | | - * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 not being defined (which means the |
74 | | - * functions are defined in libgcc instead of being inlines). |
75 | | - */ |
76 | | -/* #undef JE_FORCE_SYNC_COMPARE_AND_SWAP_8 */ |
| 57 | +/* and the 8-bit variant support. */ |
| 58 | +#define JEMALLOC_GCC_U8_SYNC_ATOMICS 1 |
77 | 59 |
|
78 | 60 | /* |
79 | 61 | * Defined if __builtin_clz() and __builtin_clzl() are available. |
|
85 | 67 | */ |
86 | 68 | /* #undef JEMALLOC_OS_UNFAIR_LOCK */ |
87 | 69 |
|
88 | | -/* |
89 | | - * Defined if OSSpin*() functions are available, as provided by Darwin, and |
90 | | - * documented in the spinlock(3) manual page. |
91 | | - */ |
92 | | -/* #undef JEMALLOC_OSSPIN */ |
93 | | - |
94 | 70 | /* Defined if syscall(2) is usable. */ |
95 | 71 | #define JEMALLOC_USE_SYSCALL |
96 | 72 |
|
|
243 | 219 | #define JEMALLOC_INTERNAL_FFSL __builtin_ffsl |
244 | 220 | #define JEMALLOC_INTERNAL_FFS __builtin_ffs |
245 | 221 |
|
| 222 | +/* |
| 223 | + * popcount*() functions to use for bitmapping. |
| 224 | + */ |
| 225 | +#define JEMALLOC_INTERNAL_POPCOUNTL __builtin_popcountl |
| 226 | +#define JEMALLOC_INTERNAL_POPCOUNT __builtin_popcount |
| 227 | + |
246 | 228 | /* |
247 | 229 | * If defined, explicitly attempt to more uniformly distribute large allocation |
248 | 230 | * pointer alignments across all cache indices. |
|
297 | 279 | * MADV_FREE, though typically with higher |
298 | 280 | * system overhead. |
299 | 281 | */ |
300 | | -// #define JEMALLOC_PURGE_MADVISE_FREE |
| 282 | +#define JEMALLOC_PURGE_MADVISE_FREE |
301 | 283 | #define JEMALLOC_PURGE_MADVISE_DONTNEED |
302 | 284 | #define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS |
303 | 285 |
|
|
379 | 361 | */ |
380 | 362 | #define JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE |
381 | 363 |
|
| 364 | +/* Performs additional safety checks when defined. */ |
| 365 | +/* #undef JEMALLOC_OPT_SAFETY_CHECKS */ |
| 366 | + |
382 | 367 | #endif /* JEMALLOC_INTERNAL_DEFS_H_ */ |
0 commit comments