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