Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/jemalloc/include/jemalloc/internal/jemalloc_preamble.h
Show All 18 Lines | |||||
# define JEMALLOC_NO_RENAME | # define JEMALLOC_NO_RENAME | ||||
# include "../jemalloc.h" | # include "../jemalloc.h" | ||||
# undef JEMALLOC_NO_RENAME | # undef JEMALLOC_NO_RENAME | ||||
#else | #else | ||||
# define JEMALLOC_N(n) __je_##n | # define JEMALLOC_N(n) __je_##n | ||||
# include "../jemalloc.h" | # include "../jemalloc.h" | ||||
#endif | #endif | ||||
#if (defined(JEMALLOC_OSATOMIC) || defined(JEMALLOC_OSSPIN)) | #if defined(JEMALLOC_OSATOMIC) | ||||
#include <libkern/OSAtomic.h> | #include <libkern/OSAtomic.h> | ||||
#endif | #endif | ||||
#ifdef JEMALLOC_ZONE | #ifdef JEMALLOC_ZONE | ||||
#include <mach/mach_error.h> | #include <mach/mach_error.h> | ||||
#include <mach/mach_init.h> | #include <mach/mach_init.h> | ||||
#include <mach/vm_map.h> | #include <mach/vm_map.h> | ||||
#endif | #endif | ||||
#include "jemalloc/internal/jemalloc_internal_macros.h" | #include "jemalloc/internal/jemalloc_internal_macros.h" | ||||
/* | /* | ||||
* Note that the ordering matters here; the hook itself is name-mangled. We | * Note that the ordering matters here; the hook itself is name-mangled. We | ||||
* want the inclusion of hooks to happen early, so that we hook as much as | * want the inclusion of hooks to happen early, so that we hook as much as | ||||
* possible. | * possible. | ||||
*/ | */ | ||||
#ifndef JEMALLOC_NO_PRIVATE_NAMESPACE | #ifndef JEMALLOC_NO_PRIVATE_NAMESPACE | ||||
# ifndef JEMALLOC_JET | # ifndef JEMALLOC_JET | ||||
# include "jemalloc/internal/private_namespace.h" | # include "jemalloc/internal/private_namespace.h" | ||||
# else | # else | ||||
# include "jemalloc/internal/private_namespace_jet.h" | # include "jemalloc/internal/private_namespace_jet.h" | ||||
# endif | # endif | ||||
#endif | #endif | ||||
#include "jemalloc/internal/hooks.h" | #include "jemalloc/internal/test_hooks.h" | ||||
#ifdef JEMALLOC_DEFINE_MADVISE_FREE | #ifdef JEMALLOC_DEFINE_MADVISE_FREE | ||||
# define JEMALLOC_MADV_FREE 8 | # define JEMALLOC_MADV_FREE 8 | ||||
#endif | #endif | ||||
static const bool config_debug = | static const bool config_debug = | ||||
#ifdef JEMALLOC_DEBUG | #ifdef JEMALLOC_DEBUG | ||||
true | true | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static const bool config_log = | static const bool config_log = | ||||
#ifdef JEMALLOC_LOG | #ifdef JEMALLOC_LOG | ||||
true | true | ||||
#else | #else | ||||
false | false | ||||
#endif | #endif | ||||
; | ; | ||||
#ifdef JEMALLOC_HAVE_SCHED_GETCPU | /* | ||||
* Are extra safety checks enabled; things like checking the size of sized | |||||
* deallocations, double-frees, etc. | |||||
*/ | |||||
static const bool config_opt_safety_checks = | |||||
#ifdef JEMALLOC_OPT_SAFETY_CHECKS | |||||
true | |||||
#elif defined(JEMALLOC_DEBUG) | |||||
/* | |||||
* This lets us only guard safety checks by one flag instead of two; fast | |||||
* checks can guard solely by config_opt_safety_checks and run in debug mode | |||||
* too. | |||||
*/ | |||||
true | |||||
#else | |||||
false | |||||
#endif | |||||
; | |||||
#if defined(_WIN32) || defined(JEMALLOC_HAVE_SCHED_GETCPU) | |||||
/* Currently percpu_arena depends on sched_getcpu. */ | /* Currently percpu_arena depends on sched_getcpu. */ | ||||
#define JEMALLOC_PERCPU_ARENA | #define JEMALLOC_PERCPU_ARENA | ||||
#endif | #endif | ||||
static const bool have_percpu_arena = | static const bool have_percpu_arena = | ||||
#ifdef JEMALLOC_PERCPU_ARENA | #ifdef JEMALLOC_PERCPU_ARENA | ||||
true | true | ||||
#else | #else | ||||
false | false | ||||
Show All 22 Lines |