These are equivalent since they fall back to the standard library. There's no need to reimpose whatever constraints the standard library already imposes.
PiperOrigin-RevId: 926341943
Change-Id: I406d1203ca2d4fec68ae7a06eef0cf2dad6916dd
These functions are not in the same namespace as their arguments, so ADL is not possible.
PiperOrigin-RevId: 926284424
Change-Id: I778c6b4de0fee337f9bd09cae98a88345f12b4c4
Recent changes (SOO, small tables, blocked elements) increased size of the destructor. There are planned changes that would increase it more.
Type-erasing reduces binary size and also reduces negative effects on the destructor binary size increase in the future.
PiperOrigin-RevId: 925614135
Change-Id: I863e10cb8c6c746c0d6a07b9b15df4029609f7cb
This function is a slow path for insertions and is rarely taken. Marking it as noinline helps keep the fast path smaller.
PiperOrigin-RevId: 924928525
Change-Id: Id7fd5fb897d01094f47819420b966aa0d837baea
This change introduces the concept of "blocked elements" for tables with capacities < Group::kWidth - 1, where we are allowed to have no empty control blocks in the main part.
These elements do not have allocated slots, reducing memory usage for small tables. The control bytes for these blocked elements are initialized to kSentinel. The allocation and deallocation logic, as well as resize operations, have been updated to account for the blocked element count.
PiperOrigin-RevId: 924878555
Change-Id: I4ed2b9c30b3ccbe3a74f560e247ed296db819c78
In the follow up changes these functions would have even more difference in the implementation.
PiperOrigin-RevId: 924857072
Change-Id: I637e532b1e6ed1e7fe5d700686d9775cc0e8ec11
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/2069
Fix documentation inconsistencies in absl/strings/escaping.h:
- Add missing `true` return value documentation to
WebSafeBase64Unescape(), aligning it with the parallel
Base64Unescape() which already documents this.
- Fix missing closing backtick in WebSafeBase64Escape() comment
(`dest` was unterminated).
- Fix inconsistent single quotes to backticks on `src`/`dest`
references, matching the style used elsewhere in the file.
Merge 0616be3080 into fe126c727b
Merging this change closes#2069
COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/2069 from DrishtiTripathi2230:docs/websafe-base64-unescape-return-value 0616be3080
PiperOrigin-RevId: 924786942
Change-Id: Idcd6d27e1da696614cd8c9417bb6facb277d1d47
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/2064Fixes#1478
absl::StrFormat compile-time format string checking relies on
__attribute__((format(...))), a GCC/Clang-specific compiler extension
that MSVC does not support. This adds a note to the file-level
documentation so MSVC users are aware that format string errors will
only be caught at runtime, not at compile time.
Merge 81977d7954 into e7a10c8ec2
Merging this change closes#2064
COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/2064 from DrishtiTripathi2230:docs/strformat-msvc-compile-time-check 81977d7954
PiperOrigin-RevId: 922922072
Change-Id: I91f545b6a1e64f3d8aba3350ac6332cb9548a40a
- Move cpu_detect to absl::base_internal, adding the kNvidiaGrace and kIntelGraniterapids enums.
- On aarch64 Linux, implement custom ISAR0.RNDR checking logic to distinguish kArmNeoverseV2 from kNvidiaGrace.
- Add IsSMTEnabled and NumContextsPerCPU
PiperOrigin-RevId: 922862384
Change-Id: I038b7732714400d6c63ff309bf20af3f436afcf5
Prior to this change logging absl::SourceLocation sometimes worked
when //absl/strings/internal/stringify_sink.h was in the transitive
includes, usually through str_cat.h.
This change adds native support to logging, to avoid dependency issues.
PiperOrigin-RevId: 922782911
Change-Id: I599390a062c6f8828985d6475a6dbd324d3e52c9
As written the lambda doesn't correctly handle sign-extension.
Closes#2061
PiperOrigin-RevId: 921439321
Change-Id: I952e9f29c957546e91d3c91d9df0bbc45b7a2888
This change refactors the "no reuse" logic from ClearBackingArray into a new helper function ClearBackingArrayNoReuse. It also clarifies that ClearBackingArray is only applicable to tables with capacity greater than MaxSmallCapacity(), adding asserts and checks to enforce this.
PiperOrigin-RevId: 920163391
Change-Id: I22b5fe24d796b00fc1231d4e42720d58a2a7aa60
This enables writing expressions such as ABSL_ASSIGN_OR_RETURN((std::tuple<int, int> t1), ...) to allow commas in the type name on MSVC's traditional preprocessor, which does not support __VA_OPT__.
PiperOrigin-RevId: 919705428
Change-Id: I6887b5607d422b8bc4586068ed42b4e9d384ee44
The comment is updated to accurately reflect that `absl::variant` was the polyfill and is now an alias for `std::variant`.
PiperOrigin-RevId: 919336725
Change-Id: If39bd3f61f229f561d547391ca97015688b1fad1
This change introduces a new overload for absl::c_move that takes two ranges, allowing elements to be moved from a source container to a destination container. The destination container must be fixed size so we can perform bounds checking.
PiperOrigin-RevId: 919189227
Change-Id: Ica35c5d8bd59ebe16564f2b2f490770899ad16f8
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/2057
Adds documentation to flat_hash_map, flat_hash_set, node_hash_map, and
node_hash_set clarifying the moved-from contract for Swiss table containers.
After a move, only destruction, assignment, and clear() are guaranteed
safe. Any other operation (e.g. size(), empty(), iteration) results in
undefined behavior.
Fixes#1928
Merge 64990acd7a into c7269872a5
Merging this change closes#2057
COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/2057 from DrishtiTripathi2230:oc/moved-from-hash-container-state 64990acd7a
PiperOrigin-RevId: 919140795
Change-Id: Ie755387c46907b0e5a78d4e21577173616c10f9f
node_hash_map uses the function TypeErasedDerefAndApplyToSlotFn to hash a
slot's key. This function accesses a slot pointer as if it were of type
Key* when in fact it is of type value_type* (aka std::pair<const Key,
Value> *). This is technically a strict aliasing violation because the
types of the pointer objects are different. Fix it by defining a new
type erased function TypeErasedDerefAndApplyToSlotFirstFn that uses the
correct type for the pointer.
PiperOrigin-RevId: 918067685
Change-Id: I5d65e0e077f84a0f869be0e24fee094b4b09fbfb