19ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris/*
29ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris * By default application code must explicitly refer to mangled symbol names,
39ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris * so that it is possible to use jemalloc in conjunction with another allocator
49ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris * in the same application.  Define JEMALLOC_MANGLE in order to cause automatic
59ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris * name mangling that matches the API prefixing that happened as a result of
69ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris * --with-mangling and/or --with-jemalloc-prefix configuration settings.
79ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris */
89ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#ifdef JEMALLOC_MANGLE
99ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  ifndef JEMALLOC_NO_DEMANGLE
109ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#    define JEMALLOC_NO_DEMANGLE
119ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  endif
129ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define malloc_conf jet_malloc_conf
139ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define malloc_message jet_malloc_message
149ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define malloc jet_malloc
159ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define calloc jet_calloc
169ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define posix_memalign jet_posix_memalign
179ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define aligned_alloc jet_aligned_alloc
189ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define realloc jet_realloc
199ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define free jet_free
209ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define mallocx jet_mallocx
219ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define rallocx jet_rallocx
229ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define xallocx jet_xallocx
239ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define sallocx jet_sallocx
249ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define dallocx jet_dallocx
259ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define nallocx jet_nallocx
269ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define mallctl jet_mallctl
279ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define mallctlnametomib jet_mallctlnametomib
289ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define mallctlbymib jet_mallctlbymib
299ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define malloc_stats_print jet_malloc_stats_print
309ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define malloc_usable_size jet_malloc_usable_size
319ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define memalign jet_memalign
329ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  define valloc jet_valloc
339ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#endif
349ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris
359ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris/*
369ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris * The jet_* macros can be used as stable alternative names for the
379ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris * public jemalloc API if JEMALLOC_NO_DEMANGLE is defined.  This is primarily
389ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris * meant for use in jemalloc itself, but it can be used by application code to
399ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris * provide isolation from the name mangling specified via --with-mangling
409ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris * and/or --with-jemalloc-prefix.
419ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris */
429ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#ifndef JEMALLOC_NO_DEMANGLE
439ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_malloc_conf
449ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_malloc_message
459ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_malloc
469ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_calloc
479ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_posix_memalign
489ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_aligned_alloc
499ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_realloc
509ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_free
519ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_mallocx
529ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_rallocx
539ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_xallocx
549ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_sallocx
559ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_dallocx
569ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_nallocx
579ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_mallctl
589ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_mallctlnametomib
599ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_mallctlbymib
609ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_malloc_stats_print
619ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_malloc_usable_size
629ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_memalign
639ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#  undef jet_valloc
649ebe2acb722ad8e29179cfbff35547f607e0f532Christopher Ferris#endif
65