diff options
author | Scott Lobdell <slobdell@google.com> | 2019-08-25 12:20:54 -0700 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2019-08-25 12:20:54 -0700 |
commit | 4f9bfdcaca2414c8959986f0a4d73f16cb15e1c4 (patch) | |
tree | 540bab5498d276cbbfad24c48a7ff989ee8b920a /libc/private/bionic_macros.h | |
parent | bfda022dd6fbbcea60e9f52496d90ece514b32da (diff) | |
parent | f77cc9b224c35fa7d1d71e7c374ef19e47b5f6a5 (diff) |
Merge RP1A.190822.001
Change-Id: Iaf90835a99d87f6246798efd2cea6fe9f750ea18
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 +} |