6static inline void *SEXP_rawptr_mask(
void *ptr, uintptr_t mask)
8 return (
void *)((uintptr_t)(ptr) & mask);
11#define SEXP_rawptr_maskT(T, ptr, mask) ((T *)SEXP_rawptr_mask((void *)(ptr), mask))
13static inline void *SEXP_rawptr_merge(
void *ptr, uintptr_t bits)
15 return (
void *)(((uintptr_t)(ptr) | bits));
18#define SEXP_rawptr_mergeT(T, ptr, bits) ((T *)SEXP_rawptr_merge((void *)(ptr), bits))
20static inline void *SEXP_rawptr_safemerge(
void *ptr, uintptr_t bits, uintptr_t mask)
22 return (
void *)(((uintptr_t)SEXP_rawptr_mask(ptr, mask))|(~mask & bits));
25#define SEXP_rawptr_safemergeT(T, ptr, bits, mask) ((T *)SEXP_rawptr_safemerge((void *)(ptr), bits, mask))
27static inline bool SEXP_rawptr_bit(
void *ptr,
int n)
29 return (
bool)(((uintptr_t)(ptr)) & (1 << n));
32static inline uintptr_t SEXP_rawptr_bitmask(
void *ptr, uintptr_t mask)
34 return ((uintptr_t)(ptr)) & mask;