about summary refs log tree commit diff
path: root/absl/base/internal
diff options
context:
space:
mode:
Diffstat (limited to 'absl/base/internal')
-rw-r--r--absl/base/internal/hide_ptr.h4
-rw-r--r--absl/base/internal/thread_identity_benchmark.cc2
2 files changed, 1 insertions, 5 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.
diff --git a/absl/base/internal/thread_identity_benchmark.cc b/absl/base/internal/thread_identity_benchmark.cc
index fe22e4cff172..242522b4418a 100644
--- a/absl/base/internal/thread_identity_benchmark.cc
+++ b/absl/base/internal/thread_identity_benchmark.cc
@@ -36,5 +36,3 @@ void BM_UnsafeCurrentThreadIdentity(benchmark::State& state) {
 BENCHMARK(BM_UnsafeCurrentThreadIdentity);
 
 }  // namespace
-
-BENCHMARK_MAIN();