2 * Override settings that were generated in jemalloc_defs.h as necessary.
5 #undef JEMALLOC_OVERRIDE_VALLOC
7 #ifndef MALLOC_PRODUCTION
8 #define MALLOC_PRODUCTION
11 #ifndef MALLOC_PRODUCTION
12 #define JEMALLOC_DEBUG
16 * The following are architecture-dependent, so conditionally define them for
17 * each supported architecture.
20 #undef JEMALLOC_TLS_MODEL
21 #undef STATIC_PAGE_SHIFT
25 #undef LG_SIZEOF_INTMAX_T
28 # define LG_SIZEOF_PTR 2
29 # define CPU_SPINWAIT __asm__ volatile("pause")
30 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
33 # define LG_SIZEOF_PTR 3
36 # define LG_SIZEOF_PTR 3
37 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
40 # define LG_SIZEOF_PTR 3
41 # define CPU_SPINWAIT __asm__ volatile("pause")
42 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
45 # define LG_SIZEOF_PTR 2
49 # define LG_SIZEOF_PTR 3
51 # define LG_SIZEOF_PTR 2
55 # define LG_SIZEOF_PTR 3
56 #elif defined(__powerpc__)
57 # define LG_SIZEOF_PTR 2
60 #ifndef JEMALLOC_TLS_MODEL
61 # define JEMALLOC_TLS_MODEL /* Default. */
64 #define STATIC_PAGE_SHIFT PAGE_SHIFT
65 #define LG_SIZEOF_INT 2
66 #define LG_SIZEOF_LONG LG_SIZEOF_PTR
67 #define LG_SIZEOF_INTMAX_T 3
69 /* Disable lazy-lock machinery, mangle isthreaded, and adjust its type. */
70 #undef JEMALLOC_LAZY_LOCK
71 extern int __isthreaded;
72 #define isthreaded ((bool)__isthreaded)
79 #undef je_posix_memalign
80 #undef je_malloc_usable_size
86 #define je_malloc __malloc
87 #define je_calloc __calloc
88 #define je_realloc __realloc
89 #define je_free __free
90 #define je_posix_memalign __posix_memalign
91 #define je_malloc_usable_size __malloc_usable_size
92 #define je_allocm __allocm
93 #define je_rallocm __rallocm
94 #define je_sallocm __sallocm
95 #define je_dallocm __dallocm
96 #define je_nallocm __nallocm
101 #define pthread_mutex_lock _pthread_mutex_lock
102 #define pthread_mutex_unlock _pthread_mutex_unlock
106 * Define 'weak' symbols so that an application can have its own versions
107 * of malloc, calloc, realloc, free, et al.
109 __weak_reference(__malloc, malloc);
110 __weak_reference(__calloc, calloc);
111 __weak_reference(__realloc, realloc);
112 __weak_reference(__free, free);
113 __weak_reference(__posix_memalign, posix_memalign);
114 __weak_reference(__malloc_usable_size, malloc_usable_size);
115 __weak_reference(__allocm, allocm);
116 __weak_reference(__rallocm, rallocm);
117 __weak_reference(__sallocm, sallocm);
118 __weak_reference(__dallocm, dallocm);
119 __weak_reference(__nallocm, nallocm);