Home | History | Annotate | Download | only in internal
      1 #ifndef JEMALLOC_INTERNAL_MACROS_H
      2 #define JEMALLOC_INTERNAL_MACROS_H
      3 
      4 #ifdef JEMALLOC_DEBUG
      5 #  define JEMALLOC_ALWAYS_INLINE static inline
      6 #else
      7 #  define JEMALLOC_ALWAYS_INLINE JEMALLOC_ATTR(always_inline) static inline
      8 #endif
      9 #ifdef _MSC_VER
     10 #  define inline _inline
     11 #endif
     12 
     13 #define UNUSED JEMALLOC_ATTR(unused)
     14 
     15 #define ZU(z)	((size_t)z)
     16 #define ZD(z)	((ssize_t)z)
     17 #define QU(q)	((uint64_t)q)
     18 #define QD(q)	((int64_t)q)
     19 
     20 #define KZU(z)	ZU(z##ULL)
     21 #define KZD(z)	ZD(z##LL)
     22 #define KQU(q)	QU(q##ULL)
     23 #define KQD(q)	QI(q##LL)
     24 
     25 #ifndef __DECONST
     26 #  define	__DECONST(type, var)	((type)(uintptr_t)(const void *)(var))
     27 #endif
     28 
     29 #if !defined(JEMALLOC_HAS_RESTRICT) || defined(__cplusplus)
     30 #  define restrict
     31 #endif
     32 
     33 /* Various function pointers are statick and immutable except during testing. */
     34 #ifdef JEMALLOC_JET
     35 #  define JET_MUTABLE
     36 #else
     37 #  define JET_MUTABLE const
     38 #endif
     39 
     40 #define JEMALLOC_VA_ARGS_HEAD(head, ...) head
     41 #define JEMALLOC_VA_ARGS_TAIL(head, ...) __VA_ARGS__
     42 
     43 #endif /* JEMALLOC_INTERNAL_MACROS_H */
     44