2 * Override settings that were generated in jemalloc_defs.h as necessary.
5 #undef JEMALLOC_OVERRIDE_VALLOC
7 #ifndef MALLOC_PRODUCTION
12 * The following are architecture-dependent, so conditionally define them for
13 * each supported architecture.
16 #undef JEMALLOC_TLS_MODEL
17 #undef STATIC_PAGE_SHIFT
21 #undef LG_SIZEOF_INTMAX_T
24 # define LG_SIZEOF_PTR 2
25 # define CPU_SPINWAIT __asm__ volatile("pause")
26 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
29 # define LG_SIZEOF_PTR 3
32 # define LG_SIZEOF_PTR 3
33 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
36 # define LG_SIZEOF_PTR 3
37 # define CPU_SPINWAIT __asm__ volatile("pause")
38 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
41 # define LG_SIZEOF_PTR 2
45 # define LG_SIZEOF_PTR 3
47 # define LG_SIZEOF_PTR 2
51 # define LG_SIZEOF_PTR 3
52 #elif defined(__powerpc__)
53 # define LG_SIZEOF_PTR 2
56 #ifndef JEMALLOC_TLS_MODEL
57 # define JEMALLOC_TLS_MODEL /* Default. */
60 #define STATIC_PAGE_SHIFT PAGE_SHIFT
61 #define LG_SIZEOF_INT 2
62 #define LG_SIZEOF_LONG LG_SIZEOF_PTR
63 #define LG_SIZEOF_INTMAX_T 3
65 /* Disable lazy-lock machinery, mangle isthreaded, and adjust its type. */
66 #undef JEMALLOC_LAZY_LOCK
67 extern int __isthreaded;
68 #define isthreaded ((bool)__isthreaded)
75 #undef je_posix_memalign
76 #undef je_malloc_usable_size
82 #define je_malloc __malloc
83 #define je_calloc __calloc
84 #define je_realloc __realloc
85 #define je_free __free
86 #define je_posix_memalign __posix_memalign
87 #define je_malloc_usable_size __malloc_usable_size
88 #define je_allocm __allocm
89 #define je_rallocm __rallocm
90 #define je_sallocm __sallocm
91 #define je_dallocm __dallocm
92 #define je_nallocm __nallocm
97 #define pthread_mutex_lock _pthread_mutex_lock
98 #define pthread_mutex_unlock _pthread_mutex_unlock
102 * Define 'weak' symbols so that an application can have its own versions
103 * of malloc, calloc, realloc, free, et al.
105 __weak_reference(__malloc, malloc);
106 __weak_reference(__calloc, calloc);
107 __weak_reference(__realloc, realloc);
108 __weak_reference(__free, free);
109 __weak_reference(__posix_memalign, posix_memalign);
110 __weak_reference(__malloc_usable_size, malloc_usable_size);
111 __weak_reference(__allocm, allocm);
112 __weak_reference(__rallocm, rallocm);
113 __weak_reference(__sallocm, sallocm);
114 __weak_reference(__dallocm, dallocm);
115 __weak_reference(__nallocm, nallocm);