2009-06-26 09:06:48 +08:00
|
|
|
#ifndef JEMALLOC_DEFS_H_
|
|
|
|
#define JEMALLOC_DEFS_H_
|
|
|
|
|
|
|
|
/*
|
|
|
|
* jemalloc version string.
|
|
|
|
*/
|
|
|
|
#undef JEMALLOC_VERSION
|
|
|
|
|
2009-12-29 16:09:15 +08:00
|
|
|
/*
|
|
|
|
* If JEMALLOC_PREFIX is defined, it will cause all public APIs to be prefixed.
|
|
|
|
* This makes it possible, with some care, to use multiple allocators
|
|
|
|
* simultaneously.
|
|
|
|
*
|
|
|
|
* In many cases it is more convenient to manually prefix allocator function
|
|
|
|
* calls than to let macros do it automatically, particularly when using
|
|
|
|
* multiple allocators simultaneously. Define JEMALLOC_MANGLE before
|
|
|
|
* #include'ing jemalloc.h in order to cause name mangling that corresponds to
|
|
|
|
* the API prefixing.
|
|
|
|
*/
|
|
|
|
#undef JEMALLOC_PREFIX
|
|
|
|
#if (defined(JEMALLOC_PREFIX) && defined(JEMALLOC_MANGLE))
|
|
|
|
#undef malloc
|
|
|
|
#undef calloc
|
|
|
|
#undef posix_memalign
|
|
|
|
#undef realloc
|
|
|
|
#undef free
|
|
|
|
#undef malloc_usable_size
|
2009-12-29 16:09:15 +08:00
|
|
|
#undef malloc_tcache_flush
|
2010-01-04 04:10:42 +08:00
|
|
|
#undef malloc_stats_print
|
2009-12-29 16:09:15 +08:00
|
|
|
#undef malloc_options
|
|
|
|
#undef malloc_message
|
|
|
|
#endif
|
|
|
|
|
2009-06-24 10:01:18 +08:00
|
|
|
/*
|
|
|
|
* Hyper-threaded CPUs may need a special instruction inside spin loops in
|
|
|
|
* order to yield to another virtual CPU.
|
|
|
|
*/
|
|
|
|
#undef CPU_SPINWAIT
|
|
|
|
|
2010-01-04 03:59:20 +08:00
|
|
|
/* Defined if __attribute__((...)) syntax is supported. */
|
|
|
|
#undef JEMALLOC_HAVE_ATTR
|
|
|
|
#ifdef JEMALLOC_HAVE_ATTR
|
|
|
|
# define JEMALLOC_ATTR(s) __attribute__((s))
|
|
|
|
#else
|
|
|
|
# define JEMALLOC_ATTR(s)
|
|
|
|
#endif
|
2009-07-01 07:17:05 +08:00
|
|
|
|
2009-06-24 10:01:18 +08:00
|
|
|
/*
|
|
|
|
* JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
|
|
|
|
* inline functions.
|
|
|
|
*/
|
|
|
|
#undef JEMALLOC_DEBUG
|
|
|
|
|
|
|
|
/* JEMALLOC_STATS enables statistics calculation. */
|
|
|
|
#undef JEMALLOC_STATS
|
|
|
|
|
2009-12-29 16:09:15 +08:00
|
|
|
/* JEMALLOC_TRACE enables allocation tracing. */
|
|
|
|
#undef JEMALLOC_TRACE
|
|
|
|
|
2009-06-24 10:01:18 +08:00
|
|
|
/*
|
|
|
|
* JEMALLOC_TINY enables support for tiny objects, which are smaller than one
|
|
|
|
* quantum.
|
|
|
|
*/
|
|
|
|
#undef JEMALLOC_TINY
|
|
|
|
|
|
|
|
/*
|
2009-12-29 16:09:15 +08:00
|
|
|
* JEMALLOC_TCACHE enables a thread-specific caching layer for small and medium
|
2009-06-24 10:01:18 +08:00
|
|
|
* objects. This makes it possible to allocate/deallocate objects without any
|
|
|
|
* locking when the cache is in the steady state.
|
|
|
|
*/
|
2009-12-29 16:09:15 +08:00
|
|
|
#undef JEMALLOC_TCACHE
|
2009-06-24 10:01:18 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage
|
|
|
|
* segment (DSS).
|
|
|
|
*/
|
|
|
|
#undef JEMALLOC_DSS
|
|
|
|
|
|
|
|
/* Support memory filling (junk/zero). */
|
|
|
|
#undef JEMALLOC_FILL
|
|
|
|
|
|
|
|
/* Support optional abort() on OOM. */
|
|
|
|
#undef JEMALLOC_XMALLOC
|
|
|
|
|
|
|
|
/* Support SYSV semantics. */
|
|
|
|
#undef JEMALLOC_SYSV
|
|
|
|
|
|
|
|
/* Support lazy locking (avoid locking unless a second thread is launched). */
|
|
|
|
#undef JEMALLOC_LAZY_LOCK
|
|
|
|
|
|
|
|
/* Determine page size at run time if defined. */
|
|
|
|
#undef DYNAMIC_PAGE_SHIFT
|
|
|
|
|
|
|
|
/* One page is 2^STATIC_PAGE_SHIFT bytes. */
|
|
|
|
#undef STATIC_PAGE_SHIFT
|
|
|
|
|
|
|
|
/* TLS is used to map arenas and magazine caches to threads. */
|
|
|
|
#undef NO_TLS
|
|
|
|
|
2009-12-29 16:09:15 +08:00
|
|
|
/* sizeof(void *) == 2^LG_SIZEOF_PTR. */
|
|
|
|
#undef LG_SIZEOF_PTR
|
|
|
|
|
|
|
|
/* sizeof(int) == 2^LG_SIZEOF_INT. */
|
|
|
|
#undef LG_SIZEOF_INT
|
2009-06-26 09:06:48 +08:00
|
|
|
|
|
|
|
#endif /* JEMALLOC_DEFS_H_ */
|