about summary refs log tree commit diff
path: root/absl/base/internal/hide_ptr.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/base/internal/hide_ptr.h')
-rw-r--r--absl/base/internal/hide_ptr.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/absl/base/internal/hide_ptr.h b/absl/base/internal/hide_ptr.h
index 2c2e11f679a0..45cf438912c2 100644
--- a/absl/base/internal/hide_ptr.h
+++ b/absl/base/internal/hide_ptr.h
@@ -23,9 +23,7 @@ namespace base_internal {
 // Arbitrary value with high bits set. Xor'ing with it is unlikely
 // to map one valid pointer to another valid pointer.
 constexpr uintptr_t HideMask() {
-  static_assert(sizeof(uintptr_t) == 4 || sizeof(uintptr_t) == 8,
-                "uintptr_t must be 32 or 64 bits");
-  return sizeof(uintptr_t) == 8 ? 0xF03A5F7BF03A5F7BULL : 0xF03A5F7BUL;
+  return (uintptr_t{0xF03A5F7BU} << (sizeof(uintptr_t) - 4) * 8) | 0xF03A5F7BU;
 }
 
 // Hide a pointer from the leak checker. For internal use only.