Blame jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h.in

Packit 345191
#ifndef JEMALLOC_INTERNAL_DEFS_H_
Packit 345191
#define JEMALLOC_INTERNAL_DEFS_H_
Packit 345191
/*
Packit 345191
 * If JEMALLOC_PREFIX is defined via --with-jemalloc-prefix, it will cause all
Packit 345191
 * public APIs to be prefixed.  This makes it possible, with some care, to use
Packit 345191
 * multiple allocators simultaneously.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_PREFIX
Packit 345191
#undef JEMALLOC_CPREFIX
Packit 345191
Packit 345191
/*
Packit 345191
 * Define overrides for non-standard allocator-related functions if they are
Packit 345191
 * present on the system.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_OVERRIDE___LIBC_CALLOC
Packit 345191
#undef JEMALLOC_OVERRIDE___LIBC_FREE
Packit 345191
#undef JEMALLOC_OVERRIDE___LIBC_MALLOC
Packit 345191
#undef JEMALLOC_OVERRIDE___LIBC_MEMALIGN
Packit 345191
#undef JEMALLOC_OVERRIDE___LIBC_REALLOC
Packit 345191
#undef JEMALLOC_OVERRIDE___LIBC_VALLOC
Packit 345191
#undef JEMALLOC_OVERRIDE___POSIX_MEMALIGN
Packit 345191
Packit 345191
/*
Packit 345191
 * JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs.
Packit 345191
 * For shared libraries, symbol visibility mechanisms prevent these symbols
Packit 345191
 * from being exported, but for static libraries, naming collisions are a real
Packit 345191
 * possibility.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_PRIVATE_NAMESPACE
Packit 345191
Packit 345191
/*
Packit 345191
 * Hyper-threaded CPUs may need a special instruction inside spin loops in
Packit 345191
 * order to yield to another virtual CPU.
Packit 345191
 */
Packit 345191
#undef CPU_SPINWAIT
Packit 345191
/* 1 if CPU_SPINWAIT is defined, 0 otherwise. */
Packit 345191
#undef HAVE_CPU_SPINWAIT
Packit 345191
Packit 345191
/*
Packit 345191
 * Number of significant bits in virtual addresses.  This may be less than the
Packit 345191
 * total number of bits in a pointer, e.g. on x64, for which the uppermost 16
Packit 345191
 * bits are the same as bit 47.
Packit 345191
 */
Packit 345191
#undef LG_VADDR
Packit 345191
Packit 345191
/* Defined if C11 atomics are available. */
Packit 345191
#undef JEMALLOC_C11_ATOMICS
Packit 345191
Packit 345191
/* Defined if GCC __atomic atomics are available. */
Packit 345191
#undef JEMALLOC_GCC_ATOMIC_ATOMICS
Packit 345191
/* and the 8-bit variant support. */
Packit 345191
#undef JEMALLOC_GCC_U8_ATOMIC_ATOMICS
Packit 345191
Packit 345191
/* Defined if GCC __sync atomics are available. */
Packit 345191
#undef JEMALLOC_GCC_SYNC_ATOMICS
Packit 345191
/* and the 8-bit variant support. */
Packit 345191
#undef JEMALLOC_GCC_U8_SYNC_ATOMICS
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if __builtin_clz() and __builtin_clzl() are available.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_HAVE_BUILTIN_CLZ
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if os_unfair_lock_*() functions are available, as provided by Darwin.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_OS_UNFAIR_LOCK
Packit 345191
Packit 345191
/* Defined if syscall(2) is usable. */
Packit 345191
#undef JEMALLOC_USE_SYSCALL
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if secure_getenv(3) is available.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_HAVE_SECURE_GETENV
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if issetugid(2) is available.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_HAVE_ISSETUGID
Packit 345191
Packit 345191
/* Defined if pthread_atfork(3) is available. */
Packit 345191
#undef JEMALLOC_HAVE_PTHREAD_ATFORK
Packit 345191
Packit 345191
/* Defined if pthread_setname_np(3) is available. */
Packit 345191
#undef JEMALLOC_HAVE_PTHREAD_SETNAME_NP
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is available.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_HAVE_CLOCK_MONOTONIC_COARSE
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if clock_gettime(CLOCK_MONOTONIC, ...) is available.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_HAVE_CLOCK_MONOTONIC
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if mach_absolute_time() is available.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_HAVE_MACH_ABSOLUTE_TIME
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if _malloc_thread_cleanup() exists.  At least in the case of
Packit 345191
 * FreeBSD, pthread_key_create() allocates, which if used during malloc
Packit 345191
 * bootstrapping will cause recursion into the pthreads library.  Therefore, if
Packit 345191
 * _malloc_thread_cleanup() exists, use it as the basis for thread cleanup in
Packit 345191
 * malloc_tsd.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_MALLOC_THREAD_CLEANUP
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if threaded initialization is known to be safe on this platform.
Packit 345191
 * Among other things, it must be possible to initialize a mutex without
Packit 345191
 * triggering allocation in order for threaded allocation to be safe.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_THREADED_INIT
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if the pthreads implementation defines
Packit 345191
 * _pthread_mutex_init_calloc_cb(), in which case the function is used in order
Packit 345191
 * to avoid recursive allocation during mutex initialization.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_MUTEX_INIT_CB
Packit 345191
Packit 345191
/* Non-empty if the tls_model attribute is supported. */
Packit 345191
#undef JEMALLOC_TLS_MODEL
Packit 345191
Packit 345191
/*
Packit 345191
 * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
Packit 345191
 * inline functions.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_DEBUG
Packit 345191
Packit 345191
/* JEMALLOC_STATS enables statistics calculation. */
Packit 345191
#undef JEMALLOC_STATS
Packit 345191
Packit 345191
/* JEMALLOC_EXPERIMENTAL_SMALLOCX_API enables experimental smallocx API. */
Packit 345191
#undef JEMALLOC_EXPERIMENTAL_SMALLOCX_API
Packit 345191
Packit 345191
/* JEMALLOC_PROF enables allocation profiling. */
Packit 345191
#undef JEMALLOC_PROF
Packit 345191
Packit 345191
/* Use libunwind for profile backtracing if defined. */
Packit 345191
#undef JEMALLOC_PROF_LIBUNWIND
Packit 345191
Packit 345191
/* Use libgcc for profile backtracing if defined. */
Packit 345191
#undef JEMALLOC_PROF_LIBGCC
Packit 345191
Packit 345191
/* Use gcc intrinsics for profile backtracing if defined. */
Packit 345191
#undef JEMALLOC_PROF_GCC
Packit 345191
Packit 345191
/*
Packit 345191
 * JEMALLOC_DSS enables use of sbrk(2) to allocate extents from the data storage
Packit 345191
 * segment (DSS).
Packit 345191
 */
Packit 345191
#undef JEMALLOC_DSS
Packit 345191
Packit 345191
/* Support memory filling (junk/zero). */
Packit 345191
#undef JEMALLOC_FILL
Packit 345191
Packit 345191
/* Support utrace(2)-based tracing. */
Packit 345191
#undef JEMALLOC_UTRACE
Packit 345191
Packit 345191
/* Support optional abort() on OOM. */
Packit 345191
#undef JEMALLOC_XMALLOC
Packit 345191
Packit 345191
/* Support lazy locking (avoid locking unless a second thread is launched). */
Packit 345191
#undef JEMALLOC_LAZY_LOCK
Packit 345191
Packit 345191
/*
Packit 345191
 * Minimum allocation alignment is 2^LG_QUANTUM bytes (ignoring tiny size
Packit 345191
 * classes).
Packit 345191
 */
Packit 345191
#undef LG_QUANTUM
Packit 345191
Packit 345191
/* One page is 2^LG_PAGE bytes. */
Packit 345191
#undef LG_PAGE
Packit 345191
Packit 345191
/*
Packit 345191
 * One huge page is 2^LG_HUGEPAGE bytes.  Note that this is defined even if the
Packit 345191
 * system does not explicitly support huge pages; system calls that require
Packit 345191
 * explicit huge page support are separately configured.
Packit 345191
 */
Packit 345191
#undef LG_HUGEPAGE
Packit 345191
Packit 345191
/*
Packit 345191
 * If defined, adjacent virtual memory mappings with identical attributes
Packit 345191
 * automatically coalesce, and they fragment when changes are made to subranges.
Packit 345191
 * This is the normal order of things for mmap()/munmap(), but on Windows
Packit 345191
 * VirtualAlloc()/VirtualFree() operations must be precisely matched, i.e.
Packit 345191
 * mappings do *not* coalesce/fragment.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_MAPS_COALESCE
Packit 345191
Packit 345191
/*
Packit 345191
 * If defined, retain memory for later reuse by default rather than using e.g.
Packit 345191
 * munmap() to unmap freed extents.  This is enabled on 64-bit Linux because
Packit 345191
 * common sequences of mmap()/munmap() calls will cause virtual memory map
Packit 345191
 * holes.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_RETAIN
Packit 345191
Packit 345191
/* TLS is used to map arenas and magazine caches to threads. */
Packit 345191
#undef JEMALLOC_TLS
Packit 345191
Packit 345191
/*
Packit 345191
 * Used to mark unreachable code to quiet "end of non-void" compiler warnings.
Packit 345191
 * Don't use this directly; instead use unreachable() from util.h
Packit 345191
 */
Packit 345191
#undef JEMALLOC_INTERNAL_UNREACHABLE
Packit 345191
Packit 345191
/*
Packit 345191
 * ffs*() functions to use for bitmapping.  Don't use these directly; instead,
Packit 345191
 * use ffs_*() from util.h.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_INTERNAL_FFSLL
Packit 345191
#undef JEMALLOC_INTERNAL_FFSL
Packit 345191
#undef JEMALLOC_INTERNAL_FFS
Packit 345191
Packit 345191
/*
Packit 345191
 * popcount*() functions to use for bitmapping.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_INTERNAL_POPCOUNTL
Packit 345191
#undef JEMALLOC_INTERNAL_POPCOUNT
Packit 345191
Packit 345191
/*
Packit 345191
 * If defined, explicitly attempt to more uniformly distribute large allocation
Packit 345191
 * pointer alignments across all cache indices.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_CACHE_OBLIVIOUS
Packit 345191
Packit 345191
/*
Packit 345191
 * If defined, enable logging facilities.  We make this a configure option to
Packit 345191
 * avoid taking extra branches everywhere.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_LOG
Packit 345191
Packit 345191
/*
Packit 345191
 * If defined, use readlinkat() (instead of readlink()) to follow
Packit 345191
 * /etc/malloc_conf.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_READLINKAT
Packit 345191
Packit 345191
/*
Packit 345191
 * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_ZONE
Packit 345191
Packit 345191
/*
Packit 345191
 * Methods for determining whether the OS overcommits.
Packit 345191
 * JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY: Linux's
Packit 345191
 *                                         /proc/sys/vm.overcommit_memory file.
Packit 345191
 * JEMALLOC_SYSCTL_VM_OVERCOMMIT: FreeBSD's vm.overcommit sysctl.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_SYSCTL_VM_OVERCOMMIT
Packit 345191
#undef JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY
Packit 345191
Packit 345191
/* Defined if madvise(2) is available. */
Packit 345191
#undef JEMALLOC_HAVE_MADVISE
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if transparent huge pages are supported via the MADV_[NO]HUGEPAGE
Packit 345191
 * arguments to madvise(2).
Packit 345191
 */
Packit 345191
#undef JEMALLOC_HAVE_MADVISE_HUGE
Packit 345191
Packit 345191
/*
Packit 345191
 * Methods for purging unused pages differ between operating systems.
Packit 345191
 *
Packit 345191
 *   madvise(..., MADV_FREE) : This marks pages as being unused, such that they
Packit 345191
 *                             will be discarded rather than swapped out.
Packit 345191
 *   madvise(..., MADV_DONTNEED) : If JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS is
Packit 345191
 *                                 defined, this immediately discards pages,
Packit 345191
 *                                 such that new pages will be demand-zeroed if
Packit 345191
 *                                 the address region is later touched;
Packit 345191
 *                                 otherwise this behaves similarly to
Packit 345191
 *                                 MADV_FREE, though typically with higher
Packit 345191
 *                                 system overhead.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_PURGE_MADVISE_FREE
Packit 345191
#undef JEMALLOC_PURGE_MADVISE_DONTNEED
Packit 345191
#undef JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS
Packit 345191
Packit 345191
/* Defined if madvise(2) is available but MADV_FREE is not (x86 Linux only). */
Packit 345191
#undef JEMALLOC_DEFINE_MADVISE_FREE
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if MADV_DO[NT]DUMP is supported as an argument to madvise.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_MADVISE_DONTDUMP
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if transparent huge pages (THPs) are supported via the
Packit 345191
 * MADV_[NO]HUGEPAGE arguments to madvise(2), and THP support is enabled.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_THP
Packit 345191
Packit 345191
/* Define if operating system has alloca.h header. */
Packit 345191
#undef JEMALLOC_HAS_ALLOCA_H
Packit 345191
Packit 345191
/* C99 restrict keyword supported. */
Packit 345191
#undef JEMALLOC_HAS_RESTRICT
Packit 345191
Packit 345191
/* For use by hash code. */
Packit 345191
#undef JEMALLOC_BIG_ENDIAN
Packit 345191
Packit 345191
/* sizeof(int) == 2^LG_SIZEOF_INT. */
Packit 345191
#undef LG_SIZEOF_INT
Packit 345191
Packit 345191
/* sizeof(long) == 2^LG_SIZEOF_LONG. */
Packit 345191
#undef LG_SIZEOF_LONG
Packit 345191
Packit 345191
/* sizeof(long long) == 2^LG_SIZEOF_LONG_LONG. */
Packit 345191
#undef LG_SIZEOF_LONG_LONG
Packit 345191
Packit 345191
/* sizeof(intmax_t) == 2^LG_SIZEOF_INTMAX_T. */
Packit 345191
#undef LG_SIZEOF_INTMAX_T
Packit 345191
Packit 345191
/* glibc malloc hooks (__malloc_hook, __realloc_hook, __free_hook). */
Packit 345191
#undef JEMALLOC_GLIBC_MALLOC_HOOK
Packit 345191
Packit 345191
/* glibc memalign hook. */
Packit 345191
#undef JEMALLOC_GLIBC_MEMALIGN_HOOK
Packit 345191
Packit 345191
/* pthread support */
Packit 345191
#undef JEMALLOC_HAVE_PTHREAD
Packit 345191
Packit 345191
/* dlsym() support */
Packit 345191
#undef JEMALLOC_HAVE_DLSYM
Packit 345191
Packit 345191
/* Adaptive mutex support in pthreads. */
Packit 345191
#undef JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP
Packit 345191
Packit 345191
/* GNU specific sched_getcpu support */
Packit 345191
#undef JEMALLOC_HAVE_SCHED_GETCPU
Packit 345191
Packit 345191
/* GNU specific sched_setaffinity support */
Packit 345191
#undef JEMALLOC_HAVE_SCHED_SETAFFINITY
Packit 345191
Packit 345191
/*
Packit 345191
 * If defined, all the features necessary for background threads are present.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_BACKGROUND_THREAD
Packit 345191
Packit 345191
/*
Packit 345191
 * If defined, jemalloc symbols are not exported (doesn't work when
Packit 345191
 * JEMALLOC_PREFIX is not defined).
Packit 345191
 */
Packit 345191
#undef JEMALLOC_EXPORT
Packit 345191
Packit 345191
/* config.malloc_conf options string. */
Packit 345191
#undef JEMALLOC_CONFIG_MALLOC_CONF
Packit 345191
Packit 345191
/* If defined, jemalloc takes the malloc/free/etc. symbol names. */
Packit 345191
#undef JEMALLOC_IS_MALLOC
Packit 345191
Packit 345191
/*
Packit 345191
 * Defined if strerror_r returns char * if _GNU_SOURCE is defined.
Packit 345191
 */
Packit 345191
#undef JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE
Packit 345191
Packit 345191
/* Performs additional safety checks when defined. */
Packit 345191
#undef JEMALLOC_OPT_SAFETY_CHECKS
Packit 345191
Packit 345191
#endif /* JEMALLOC_INTERNAL_DEFS_H_ */