Skip to content

Commit 82f2b1a

Browse files
committed
jemalloc: merge jemalloc_internal_defs.h.in for aarch64
- keep LG_PAGE/LG_HUGEPAGE - use upstream JEMALLOC_PURGE_MADVISE_FREE
1 parent 2f256b0 commit 82f2b1a

File tree

1 file changed

+17
-32
lines changed

1 file changed

+17
-32
lines changed

contrib/jemalloc-cmake/include_linux_aarch64/jemalloc/internal/jemalloc_internal_defs.h.in

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
/* include/jemalloc/internal/jemalloc_internal_defs.h. Generated from jemalloc_internal_defs.h.in by configure. */
22
#ifndef JEMALLOC_INTERNAL_DEFS_H_
33
#define JEMALLOC_INTERNAL_DEFS_H_
4-
5-
6-
#ifndef _GNU_SOURCE
7-
#define _GNU_SOURCE
8-
#endif
9-
104
/*
115
* If JEMALLOC_PREFIX is defined via --with-jemalloc-prefix, it will cause all
126
* public APIs to be prefixed. This makes it possible, with some care, to use
@@ -25,7 +19,7 @@
2519
#define JEMALLOC_OVERRIDE___LIBC_MEMALIGN
2620
#define JEMALLOC_OVERRIDE___LIBC_REALLOC
2721
#define JEMALLOC_OVERRIDE___LIBC_VALLOC
28-
#define JEMALLOC_OVERRIDE___POSIX_MEMALIGN
22+
/* #undef JEMALLOC_OVERRIDE___POSIX_MEMALIGN */
2923

3024
/*
3125
* JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs.
@@ -39,9 +33,9 @@
3933
* Hyper-threaded CPUs may need a special instruction inside spin loops in
4034
* order to yield to another virtual CPU.
4135
*/
42-
#define CPU_SPINWAIT
36+
#define CPU_SPINWAIT __asm__ volatile("pause")
4337
/* 1 if CPU_SPINWAIT is defined, 0 otherwise. */
44-
#define HAVE_CPU_SPINWAIT 0
38+
#define HAVE_CPU_SPINWAIT 1
4539

4640
/*
4741
* Number of significant bits in virtual addresses. This may be less than the
@@ -55,25 +49,13 @@
5549

5650
/* Defined if GCC __atomic atomics are available. */
5751
#define JEMALLOC_GCC_ATOMIC_ATOMICS 1
52+
/* and the 8-bit variant support. */
53+
#define JEMALLOC_GCC_U8_ATOMIC_ATOMICS 1
5854

5955
/* Defined if GCC __sync atomics are available. */
6056
#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
7759

7860
/*
7961
* Defined if __builtin_clz() and __builtin_clzl() are available.
@@ -85,12 +67,6 @@
8567
*/
8668
/* #undef JEMALLOC_OS_UNFAIR_LOCK */
8769

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-
9470
/* Defined if syscall(2) is usable. */
9571
#define JEMALLOC_USE_SYSCALL
9672

@@ -243,6 +219,12 @@
243219
#define JEMALLOC_INTERNAL_FFSL __builtin_ffsl
244220
#define JEMALLOC_INTERNAL_FFS __builtin_ffs
245221

222+
/*
223+
* popcount*() functions to use for bitmapping.
224+
*/
225+
#define JEMALLOC_INTERNAL_POPCOUNTL __builtin_popcountl
226+
#define JEMALLOC_INTERNAL_POPCOUNT __builtin_popcount
227+
246228
/*
247229
* If defined, explicitly attempt to more uniformly distribute large allocation
248230
* pointer alignments across all cache indices.
@@ -297,7 +279,7 @@
297279
* MADV_FREE, though typically with higher
298280
* system overhead.
299281
*/
300-
// #define JEMALLOC_PURGE_MADVISE_FREE
282+
#define JEMALLOC_PURGE_MADVISE_FREE
301283
#define JEMALLOC_PURGE_MADVISE_DONTNEED
302284
#define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS
303285

@@ -379,4 +361,7 @@
379361
*/
380362
#define JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE
381363

364+
/* Performs additional safety checks when defined. */
365+
/* #undef JEMALLOC_OPT_SAFETY_CHECKS */
366+
382367
#endif /* JEMALLOC_INTERNAL_DEFS_H_ */

0 commit comments

Comments
 (0)