|
Packit |
345191 |
#ifndef JEMALLOC_PREAMBLE_H
|
|
Packit |
345191 |
#define JEMALLOC_PREAMBLE_H
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#include "jemalloc_internal_defs.h"
|
|
Packit |
345191 |
#include "jemalloc/internal/jemalloc_internal_decls.h"
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#ifdef JEMALLOC_UTRACE
|
|
Packit |
345191 |
#include <sys/ktrace.h>
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#define JEMALLOC_NO_DEMANGLE
|
|
Packit |
345191 |
#ifdef JEMALLOC_JET
|
|
Packit |
345191 |
# undef JEMALLOC_IS_MALLOC
|
|
Packit |
345191 |
# define JEMALLOC_N(n) jet_##n
|
|
Packit |
345191 |
# include "jemalloc/internal/public_namespace.h"
|
|
Packit |
345191 |
# define JEMALLOC_NO_RENAME
|
|
Packit |
345191 |
# include "../jemalloc@install_suffix@.h"
|
|
Packit |
345191 |
# undef JEMALLOC_NO_RENAME
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
# define JEMALLOC_N(n) @private_namespace@##n
|
|
Packit |
345191 |
# include "../jemalloc@install_suffix@.h"
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#if defined(JEMALLOC_OSATOMIC)
|
|
Packit |
345191 |
#include <libkern/OSAtomic.h>
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#ifdef JEMALLOC_ZONE
|
|
Packit |
345191 |
#include <mach/mach_error.h>
|
|
Packit |
345191 |
#include <mach/mach_init.h>
|
|
Packit |
345191 |
#include <mach/vm_map.h>
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#include "jemalloc/internal/jemalloc_internal_macros.h"
|
|
Packit |
345191 |
|
|
Packit |
345191 |
/*
|
|
Packit |
345191 |
* Note that the ordering matters here; the hook itself is name-mangled. We
|
|
Packit |
345191 |
* want the inclusion of hooks to happen early, so that we hook as much as
|
|
Packit |
345191 |
* possible.
|
|
Packit |
345191 |
*/
|
|
Packit |
345191 |
#ifndef JEMALLOC_NO_PRIVATE_NAMESPACE
|
|
Packit |
345191 |
# ifndef JEMALLOC_JET
|
|
Packit |
345191 |
# include "jemalloc/internal/private_namespace.h"
|
|
Packit |
345191 |
# else
|
|
Packit |
345191 |
# include "jemalloc/internal/private_namespace_jet.h"
|
|
Packit |
345191 |
# endif
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
#include "jemalloc/internal/test_hooks.h"
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#ifdef JEMALLOC_DEFINE_MADVISE_FREE
|
|
Packit |
345191 |
# define JEMALLOC_MADV_FREE 8
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
|
|
Packit |
345191 |
static const bool config_debug =
|
|
Packit |
345191 |
#ifdef JEMALLOC_DEBUG
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool have_dss =
|
|
Packit |
345191 |
#ifdef JEMALLOC_DSS
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool have_madvise_huge =
|
|
Packit |
345191 |
#ifdef JEMALLOC_HAVE_MADVISE_HUGE
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool config_fill =
|
|
Packit |
345191 |
#ifdef JEMALLOC_FILL
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool config_lazy_lock =
|
|
Packit |
345191 |
#ifdef JEMALLOC_LAZY_LOCK
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const char * const config_malloc_conf = JEMALLOC_CONFIG_MALLOC_CONF;
|
|
Packit |
345191 |
static const bool config_prof =
|
|
Packit |
345191 |
#ifdef JEMALLOC_PROF
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool config_prof_libgcc =
|
|
Packit |
345191 |
#ifdef JEMALLOC_PROF_LIBGCC
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool config_prof_libunwind =
|
|
Packit |
345191 |
#ifdef JEMALLOC_PROF_LIBUNWIND
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool maps_coalesce =
|
|
Packit |
345191 |
#ifdef JEMALLOC_MAPS_COALESCE
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool config_stats =
|
|
Packit |
345191 |
#ifdef JEMALLOC_STATS
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool config_tls =
|
|
Packit |
345191 |
#ifdef JEMALLOC_TLS
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool config_utrace =
|
|
Packit |
345191 |
#ifdef JEMALLOC_UTRACE
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool config_xmalloc =
|
|
Packit |
345191 |
#ifdef JEMALLOC_XMALLOC
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool config_cache_oblivious =
|
|
Packit |
345191 |
#ifdef JEMALLOC_CACHE_OBLIVIOUS
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
/*
|
|
Packit |
345191 |
* Undocumented, for jemalloc development use only at the moment. See the note
|
|
Packit |
345191 |
* in jemalloc/internal/log.h.
|
|
Packit |
345191 |
*/
|
|
Packit |
345191 |
static const bool config_log =
|
|
Packit |
345191 |
#ifdef JEMALLOC_LOG
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
/*
|
|
Packit |
345191 |
* Are extra safety checks enabled; things like checking the size of sized
|
|
Packit |
345191 |
* deallocations, double-frees, etc.
|
|
Packit |
345191 |
*/
|
|
Packit |
345191 |
static const bool config_opt_safety_checks =
|
|
Packit |
345191 |
#ifdef JEMALLOC_OPT_SAFETY_CHECKS
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#elif defined(JEMALLOC_DEBUG)
|
|
Packit |
345191 |
/*
|
|
Packit |
345191 |
* This lets us only guard safety checks by one flag instead of two; fast
|
|
Packit |
345191 |
* checks can guard solely by config_opt_safety_checks and run in debug mode
|
|
Packit |
345191 |
* too.
|
|
Packit |
345191 |
*/
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#if defined(_WIN32) || defined(JEMALLOC_HAVE_SCHED_GETCPU)
|
|
Packit |
345191 |
/* Currently percpu_arena depends on sched_getcpu. */
|
|
Packit |
345191 |
#define JEMALLOC_PERCPU_ARENA
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
static const bool have_percpu_arena =
|
|
Packit |
345191 |
#ifdef JEMALLOC_PERCPU_ARENA
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
/*
|
|
Packit |
345191 |
* Undocumented, and not recommended; the application should take full
|
|
Packit |
345191 |
* responsibility for tracking provenance.
|
|
Packit |
345191 |
*/
|
|
Packit |
345191 |
static const bool force_ivsalloc =
|
|
Packit |
345191 |
#ifdef JEMALLOC_FORCE_IVSALLOC
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
static const bool have_background_thread =
|
|
Packit |
345191 |
#ifdef JEMALLOC_BACKGROUND_THREAD
|
|
Packit |
345191 |
true
|
|
Packit |
345191 |
#else
|
|
Packit |
345191 |
false
|
|
Packit |
345191 |
#endif
|
|
Packit |
345191 |
;
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#endif /* JEMALLOC_PREAMBLE_H */
|