Rizin
unix-like reverse engineering framework and cli tools
jemalloc_internal_macros.h
Go to the documentation of this file.
1 /*
2  * JEMALLOC_ALWAYS_INLINE and JEMALLOC_INLINE are used within header files for
3  * functions that are static inline functions if inlining is enabled, and
4  * single-definition library-private functions if inlining is disabled.
5  *
6  * JEMALLOC_ALWAYS_INLINE_C and JEMALLOC_INLINE_C are for use in .c files, in
7  * which case the denoted functions are always static, regardless of whether
8  * inlining is enabled.
9  */
10 #if defined(JEMALLOC_DEBUG) || defined(JEMALLOC_CODE_COVERAGE)
11  /* Disable inlining to make debugging/profiling easier. */
12 # define JEMALLOC_ALWAYS_INLINE
13 # define JEMALLOC_ALWAYS_INLINE_C static
14 # undef JEMALLOC_INLINE
15 # define JEMALLOC_INLINE_C static
16 # define inline
17 #else
18 // # define JEMALLOC_ENABLE_INLINE
19 # ifdef JEMALLOC_HAVE_ATTR
20 # define JEMALLOC_ALWAYS_INLINE \
21  static inline JEMALLOC_ATTR(unused) JEMALLOC_ATTR(always_inline)
22 # define JEMALLOC_ALWAYS_INLINE_C \
23  static inline JEMALLOC_ATTR(always_inline)
24 # else
25 # define JEMALLOC_ALWAYS_INLINE static inline
26 # define JEMALLOC_ALWAYS_INLINE_C static inline
27 # endif
28 # define JEMALLOC_INLINE static inline
29 # define JEMALLOC_INLINE_C static inline
30 # ifdef _MSC_VER
31 # define inline _inline
32 # endif
33 #endif
34 
35 #define ZU(z) ((size_t)z)
36 #define ZI(z) ((ssize_t)z)
37 #define QU(q) ((uint64_t)q)
38 #define QI(q) ((int64_t)q)
39 
40 #define KZU(z) ZU(z##ULL)
41 #define KZI(z) ZI(z##LL)
42 #define KQU(q) QU(q##ULL)
43 #define KQI(q) QI(q##LL)
44 
45 #ifndef __DECONST
46 # define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
47 #endif
48 
49 #ifndef JEMALLOC_HAS_RESTRICT
50 # define restrict
51 #endif