2 * Override settings that were generated in jemalloc_defs.h as necessary.
5 #undef JEMALLOC_OVERRIDE_VALLOC
7 #define MALLOC_PRODUCTION
9 #ifndef MALLOC_PRODUCTION
10 #define JEMALLOC_DEBUG
14 * The following are architecture-dependent, so conditionally define them for
15 * each supported architecture.
18 #undef JEMALLOC_TLS_MODEL
19 #undef STATIC_PAGE_SHIFT
23 #undef LG_SIZEOF_INTMAX_T
26 # define LG_SIZEOF_PTR 2
27 # define CPU_SPINWAIT __asm__ volatile("pause")
28 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
31 # define LG_SIZEOF_PTR 3
34 # define LG_SIZEOF_PTR 3
35 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
38 # define LG_SIZEOF_PTR 3
39 # define CPU_SPINWAIT __asm__ volatile("pause")
40 # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
43 # define LG_SIZEOF_PTR 2
47 # define LG_SIZEOF_PTR 3
49 # define LG_SIZEOF_PTR 2
53 # define LG_SIZEOF_PTR 3
54 #elif defined(__powerpc__)
55 # define LG_SIZEOF_PTR 2
58 #ifndef JEMALLOC_TLS_MODEL
59 # define JEMALLOC_TLS_MODEL /* Default. */
62 #define STATIC_PAGE_SHIFT PAGE_SHIFT
63 #define LG_SIZEOF_INT 2
64 #define LG_SIZEOF_LONG LG_SIZEOF_PTR
65 #define LG_SIZEOF_INTMAX_T 3
67 /* Disable lazy-lock machinery, mangle isthreaded, and adjust its type. */
68 #undef JEMALLOC_LAZY_LOCK
69 extern int __isthreaded;
70 #define isthreaded ((bool)__isthreaded)
77 #undef je_posix_memalign
78 #undef je_malloc_usable_size
84 #define je_malloc __malloc
85 #define je_calloc __calloc
86 #define je_realloc __realloc
87 #define je_free __free
88 #define je_posix_memalign __posix_memalign
89 #define je_malloc_usable_size __malloc_usable_size
90 #define je_allocm __allocm
91 #define je_rallocm __rallocm
92 #define je_sallocm __sallocm
93 #define je_dallocm __dallocm
94 #define je_nallocm __nallocm
99 #define pthread_mutex_lock _pthread_mutex_lock
100 #define pthread_mutex_unlock _pthread_mutex_unlock
104 * Define 'weak' symbols so that an application can have its own versions
105 * of malloc, calloc, realloc, free, et al.
107 __weak_reference(__malloc, malloc);
108 __weak_reference(__calloc, calloc);
109 __weak_reference(__realloc, realloc);
110 __weak_reference(__free, free);
111 __weak_reference(__posix_memalign, posix_memalign);
112 __weak_reference(__malloc_usable_size, malloc_usable_size);
113 __weak_reference(__allocm, allocm);
114 __weak_reference(__rallocm, rallocm);
115 __weak_reference(__sallocm, sallocm);
116 __weak_reference(__dallocm, dallocm);
117 __weak_reference(__nallocm, nallocm);