diff options
author | 2021-08-10 08:52:44 -0700 | |
---|---|---|
committer | 2021-08-10 12:30:11 -0400 | |
commit | 8e088c5f3c290c5ac53dd5010fd501d80b483115 (patch) | |
tree | 7deaab3f9a34b0ea1b7b7f917a73de30f02a2614 /absl/container/internal | |
parent | bf31a10b65d945665cecfb9d8807702ae4a7fde1 (diff) |
Export of internal Abseil changes
--
77cd6291781bc39e8472c706163d6951fe2ae573 by Derek Mauro <dmauro@google.com>:
absl::uint128: Use intrinsics for more operations when available
This change also inlines the division and modulus operators when
intrinsics are available for better code generation.
Fixes #987
PiperOrigin-RevId: 389895706
--
fa23339584599e07ebcb4d0a857e2553b017757c by Abseil Team <absl-team@google.com>:
only hide retired flags if human-readable output is requested
PiperOrigin-RevId: 389835452
--
f1111f2b88359d4b253d4d81681c8a488458a36e by Martijn Vels <mvels@google.com>:
Add helpers IsFlat(), IsExternal(), etc to improve readability
PiperOrigin-RevId: 389779333
--
785b8712261e41695ebeeb64b4317f93b37adc11 by Martijn Vels <mvels@google.com>:
Split off 'concat' and 'btree' RepMemoryUsageLeaf and RepMemoryUsageDataEdge
PiperOrigin-RevId: 389701120
--
5264bffebffc2b377bf7e18f0ce69a3ed38c6629 by CJ Johnson <johnsoncj@google.com>:
Eagerly destroy `Callback` in `absl::Cleanup`
PiperOrigin-RevId: 389678813
--
a05312f0668458e97c50ca932c8f974c1508ebf2 by Abseil Team <absl-team@google.com>:
Have one instance of empty_group per program, rather than one per translation unit.
https://stackoverflow.com/questions/185624/static-variables-in-an-inlined-function
PiperOrigin-RevId: 389185845
GitOrigin-RevId: 77cd6291781bc39e8472c706163d6951fe2ae573
Change-Id: Iac8d9cb27707a9562c831c77a552d1fb4bb0405f
Diffstat (limited to 'absl/container/internal')
-rw-r--r-- | absl/container/internal/raw_hash_set.cc | 6 | ||||
-rw-r--r-- | absl/container/internal/raw_hash_set.h | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/absl/container/internal/raw_hash_set.cc b/absl/container/internal/raw_hash_set.cc index a5dee6aa..e219956f 100644 --- a/absl/container/internal/raw_hash_set.cc +++ b/absl/container/internal/raw_hash_set.cc @@ -23,6 +23,12 @@ namespace absl { ABSL_NAMESPACE_BEGIN namespace container_internal { +ABSL_CONST_INIT ABSL_DLL alignas(16) const ctrl_t kEmptyGroup[16] = { + ctrl_t::kSentinel, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, + ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, + ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, + ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty}; + constexpr size_t Group::kWidth; // Returns "random" seed. diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index d7783263..bafafd46 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h @@ -291,13 +291,9 @@ static_assert(ctrl_t::kDeleted == static_cast<ctrl_t>(-2), // A single block of empty control bytes for tables without any slots allocated. // This enables removing a branch in the hot path of find(). +ABSL_DLL extern const ctrl_t kEmptyGroup[16]; inline ctrl_t* EmptyGroup() { - alignas(16) static constexpr ctrl_t empty_group[] = { - ctrl_t::kSentinel, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, - ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, - ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, - ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty}; - return const_cast<ctrl_t*>(empty_group); + return const_cast<ctrl_t*>(kEmptyGroup); } // Mixes a randomly generated per-process seed with `hash` and `ctrl` to |