[netcore] Reorder test targets
[mono-project.git] / mono / utils / mono-jemalloc.h
blob6721877f514285e68b7b2b01ebcc3bd21198cbe7
1 /**
2 * \file
4 * Header for jemalloc registration code
5 */
7 #ifndef __MONO_JEMALLOC_H__
8 #define __MONO_JEMALLOC_H__
10 #if defined(MONO_JEMALLOC_ENABLED)
12 #include <jemalloc/jemalloc.h>
14 /* Jemalloc can be configured in three ways.
15 * 1. You can use it with library loading hacks at run-time
16 * 2. You can use it as a global malloc replacement
17 * 3. You can use it with a prefix. If you use it with a prefix, you have to explicitly name the malloc function.
19 * In order to make this feature able to be toggled at run-time, I chose to use a prefix of mono_je.
20 * This mapping is captured below in the header, in the spirit of "no magic constants".
22 * The place that configures jemalloc and sets this prefix is in the Makefile in
23 * mono/jemalloc/Makefile.am
26 #define MONO_JEMALLOC_MALLOC mono_jemalloc
27 #define MONO_JEMALLOC_REALLOC mono_jerealloc
28 #define MONO_JEMALLOC_FREE mono_jefree
29 #define MONO_JEMALLOC_CALLOC mono_jecalloc
31 void mono_init_jemalloc (void);
33 #endif
35 #endif