jemalloc_internal_macros.h revision 748dfac7788e3cbc2fc6d36196a81d3f002669f6
1/*
2 * JEMALLOC_ALWAYS_INLINE is used within header files for functions that are
3 * static inline functions if inlining is enabled, and single-definition
4 * library-private functions if inlining is disabled.
5 *
6 * JEMALLOC_ALWAYS_INLINE_C is for use in .c files, in which case the denoted
7 * functions are always static, regardless of whether inlining is enabled.
8 */
9#if defined(JEMALLOC_DEBUG) || defined(JEMALLOC_CODE_COVERAGE)
10   /* Disable inlining to make debugging/profiling easier. */
11#  define JEMALLOC_ALWAYS_INLINE
12#  define JEMALLOC_ALWAYS_INLINE_C static
13#  define JEMALLOC_INLINE
14#  define inline
15#else
16#  define JEMALLOC_ENABLE_INLINE
17#  ifdef JEMALLOC_HAVE_ATTR
18#    define JEMALLOC_ALWAYS_INLINE \
19	 static inline JEMALLOC_ATTR(unused) JEMALLOC_ATTR(always_inline)
20#    define JEMALLOC_ALWAYS_INLINE_C \
21	 static inline JEMALLOC_ATTR(always_inline)
22#  else
23#    define JEMALLOC_ALWAYS_INLINE static inline
24#    define JEMALLOC_ALWAYS_INLINE_C static inline
25#  endif
26#  define JEMALLOC_INLINE static inline
27#  ifdef _MSC_VER
28#    define inline _inline
29#  endif
30#endif
31
32#ifdef JEMALLOC_CC_SILENCE
33#define	UNUSED JEMALLOC_ATTR(unused)
34#else
35#define	UNUSED
36#endif
37
38#define	ZU(z)	((size_t)z)
39#define	QU(q)	((uint64_t)q)
40
41#ifndef __DECONST
42#  define	__DECONST(type, var)	((type)(uintptr_t)(const void *)(var))
43#endif
44
45