diff options
Diffstat (limited to 'libc/private/bionic_macros.h')
-rw-r--r-- | libc/private/bionic_macros.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libc/private/bionic_macros.h b/libc/private/bionic_macros.h index 4800e3af9..13934e5f6 100644 --- a/libc/private/bionic_macros.h +++ b/libc/private/bionic_macros.h @@ -87,3 +87,12 @@ char (&ArraySizeHelper(T (&array)[N]))[N]; // NOLINT(readability/casting) #else #define __BIONIC_FALLTHROUGH #endif + +template <typename T> +static inline T* untag_address(T* p) { +#if defined(__aarch64__) + return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) & ((1ULL << 56) - 1)); +#else + return p; +#endif +} |