summaryrefslogtreecommitdiff
path: root/absl/container/internal
diff options
context:
space:
mode:
authorGravatar Evan Brown <ezb@google.com>2024-03-12 12:20:46 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2024-03-12 12:21:42 -0700
commit686aae12d4766631cb2e0f9da0895f4df6db8c30 (patch)
tree4447120e0f37cefa9e39d1869c3a3d2aa8e30e4f /absl/container/internal
parent5e54c9da450119ad9d632a16dca15aece0dd342c (diff)
Make swisstable SOO support GDB pretty printing and still compile in OSS.
PiperOrigin-RevId: 615131303 Change-Id: I68fcbdd943594983c67f8e07810b05d5fa9a6f2e
Diffstat (limited to 'absl/container/internal')
-rw-r--r--absl/container/internal/raw_hash_set.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h
index 750f51ef..258458b0 100644
--- a/absl/container/internal/raw_hash_set.h
+++ b/absl/container/internal/raw_hash_set.h
@@ -2195,11 +2195,6 @@ class raw_hash_set {
sizeof(slot_type) <= sizeof(HeapOrSoo) &&
alignof(slot_type) <= alignof(HeapOrSoo);
}
- // TODO(b/289225379): this is used for pretty printing in GDB/LLDB, but if we
- // use this instead of SooEnabled(), then we get compile errors in some OSS
- // compilers due to incomplete mapped_type in flat_hash_map. We need to
- // resolve this before launching SOO.
- // constexpr static bool kSooEnabled = SooEnabled();
// Whether `size` fits in the SOO capacity of this table.
bool fits_in_soo(size_t size) const {
@@ -2689,9 +2684,9 @@ class raw_hash_set {
const size_t cap = common().capacity();
// Use local variables because compiler complains about using functions in
// assume.
- ABSL_ATTRIBUTE_UNUSED static constexpr bool kSooEnabled = SooEnabled();
- ABSL_ATTRIBUTE_UNUSED static constexpr size_t kSooCapacity = SooCapacity();
- ABSL_ASSUME(!kSooEnabled || cap >= kSooCapacity);
+ ABSL_ATTRIBUTE_UNUSED static constexpr bool kEnabled = SooEnabled();
+ ABSL_ATTRIBUTE_UNUSED static constexpr size_t kCapacity = SooCapacity();
+ ABSL_ASSUME(!kEnabled || cap >= kCapacity);
return cap;
}
size_t max_size() const { return (std::numeric_limits<size_t>::max)(); }