xref: /aosp_15_r20/external/jemalloc_new/include/jemalloc/jemalloc_mangle.h (revision 1208bc7e437ced7eb82efac44ba17e3beba411da)
1*1208bc7eSAndroid Build Coastguard Worker /*
2*1208bc7eSAndroid Build Coastguard Worker  * By default application code must explicitly refer to mangled symbol names,
3*1208bc7eSAndroid Build Coastguard Worker  * so that it is possible to use jemalloc in conjunction with another allocator
4*1208bc7eSAndroid Build Coastguard Worker  * in the same application.  Define JEMALLOC_MANGLE in order to cause automatic
5*1208bc7eSAndroid Build Coastguard Worker  * name mangling that matches the API prefixing that happened as a result of
6*1208bc7eSAndroid Build Coastguard Worker  * --with-mangling and/or --with-jemalloc-prefix configuration settings.
7*1208bc7eSAndroid Build Coastguard Worker  */
8*1208bc7eSAndroid Build Coastguard Worker #ifdef JEMALLOC_MANGLE
9*1208bc7eSAndroid Build Coastguard Worker #  ifndef JEMALLOC_NO_DEMANGLE
10*1208bc7eSAndroid Build Coastguard Worker #    define JEMALLOC_NO_DEMANGLE
11*1208bc7eSAndroid Build Coastguard Worker #  endif
12*1208bc7eSAndroid Build Coastguard Worker #  define aligned_alloc je_aligned_alloc
13*1208bc7eSAndroid Build Coastguard Worker #  define calloc je_calloc
14*1208bc7eSAndroid Build Coastguard Worker #  define dallocx je_dallocx
15*1208bc7eSAndroid Build Coastguard Worker #  define free je_free
16*1208bc7eSAndroid Build Coastguard Worker #  define mallctl je_mallctl
17*1208bc7eSAndroid Build Coastguard Worker #  define mallctlbymib je_mallctlbymib
18*1208bc7eSAndroid Build Coastguard Worker #  define mallctlnametomib je_mallctlnametomib
19*1208bc7eSAndroid Build Coastguard Worker #  define malloc je_malloc
20*1208bc7eSAndroid Build Coastguard Worker #  define malloc_conf je_malloc_conf
21*1208bc7eSAndroid Build Coastguard Worker #  define malloc_message je_malloc_message
22*1208bc7eSAndroid Build Coastguard Worker #  define malloc_stats_print je_malloc_stats_print
23*1208bc7eSAndroid Build Coastguard Worker #  define malloc_usable_size je_malloc_usable_size
24*1208bc7eSAndroid Build Coastguard Worker #  define mallocx je_mallocx
25*1208bc7eSAndroid Build Coastguard Worker #  define nallocx je_nallocx
26*1208bc7eSAndroid Build Coastguard Worker #  define posix_memalign je_posix_memalign
27*1208bc7eSAndroid Build Coastguard Worker #  define rallocx je_rallocx
28*1208bc7eSAndroid Build Coastguard Worker #  define realloc je_realloc
29*1208bc7eSAndroid Build Coastguard Worker #  define sallocx je_sallocx
30*1208bc7eSAndroid Build Coastguard Worker #  define sdallocx je_sdallocx
31*1208bc7eSAndroid Build Coastguard Worker #  define xallocx je_xallocx
32*1208bc7eSAndroid Build Coastguard Worker #  define memalign je_memalign
33*1208bc7eSAndroid Build Coastguard Worker #  define valloc je_valloc
34*1208bc7eSAndroid Build Coastguard Worker #endif
35*1208bc7eSAndroid Build Coastguard Worker 
36*1208bc7eSAndroid Build Coastguard Worker /*
37*1208bc7eSAndroid Build Coastguard Worker  * The je_* macros can be used as stable alternative names for the
38*1208bc7eSAndroid Build Coastguard Worker  * public jemalloc API if JEMALLOC_NO_DEMANGLE is defined.  This is primarily
39*1208bc7eSAndroid Build Coastguard Worker  * meant for use in jemalloc itself, but it can be used by application code to
40*1208bc7eSAndroid Build Coastguard Worker  * provide isolation from the name mangling specified via --with-mangling
41*1208bc7eSAndroid Build Coastguard Worker  * and/or --with-jemalloc-prefix.
42*1208bc7eSAndroid Build Coastguard Worker  */
43*1208bc7eSAndroid Build Coastguard Worker #ifndef JEMALLOC_NO_DEMANGLE
44*1208bc7eSAndroid Build Coastguard Worker #  undef je_aligned_alloc
45*1208bc7eSAndroid Build Coastguard Worker #  undef je_calloc
46*1208bc7eSAndroid Build Coastguard Worker #  undef je_dallocx
47*1208bc7eSAndroid Build Coastguard Worker #  undef je_free
48*1208bc7eSAndroid Build Coastguard Worker #  undef je_mallctl
49*1208bc7eSAndroid Build Coastguard Worker #  undef je_mallctlbymib
50*1208bc7eSAndroid Build Coastguard Worker #  undef je_mallctlnametomib
51*1208bc7eSAndroid Build Coastguard Worker #  undef je_malloc
52*1208bc7eSAndroid Build Coastguard Worker #  undef je_malloc_conf
53*1208bc7eSAndroid Build Coastguard Worker #  undef je_malloc_message
54*1208bc7eSAndroid Build Coastguard Worker #  undef je_malloc_stats_print
55*1208bc7eSAndroid Build Coastguard Worker #  undef je_malloc_usable_size
56*1208bc7eSAndroid Build Coastguard Worker #  undef je_mallocx
57*1208bc7eSAndroid Build Coastguard Worker #  undef je_nallocx
58*1208bc7eSAndroid Build Coastguard Worker #  undef je_posix_memalign
59*1208bc7eSAndroid Build Coastguard Worker #  undef je_rallocx
60*1208bc7eSAndroid Build Coastguard Worker #  undef je_realloc
61*1208bc7eSAndroid Build Coastguard Worker #  undef je_sallocx
62*1208bc7eSAndroid Build Coastguard Worker #  undef je_sdallocx
63*1208bc7eSAndroid Build Coastguard Worker #  undef je_xallocx
64*1208bc7eSAndroid Build Coastguard Worker #  undef je_memalign
65*1208bc7eSAndroid Build Coastguard Worker #  undef je_valloc
66*1208bc7eSAndroid Build Coastguard Worker #endif
67