This associates debug information with the assertion sites, allowing clearer stack-traces for assertion failures and better accounting of the performance overhead of assertions.
PiperOrigin-RevId: 910863016
Change-Id: Ic615a9eeb8ad4b3f8c035074df4ff8347190e5c7
This will let us deprecate the declarations without triggering warnings in Abseil itself.
PiperOrigin-RevId: 894202105
Change-Id: I57bb2a1647be1fedf9b724a07042fd0f564ce074
absl::variant, and related types
The corresponding headers are removed from cc files, but kept in
headers to prevent breakages from transitive dependencies.
PiperOrigin-RevId: 872421685
Change-Id: I867d4c3f7c9e422289c63816d44719b0530fb0a6
prior to C++17. `absl::string_view` is now an alias for `std::string_view`.
It is recommended that clients simply use `std::string_view`.
PiperOrigin-RevId: 845822478
Change-Id: I220530c84118e5b9ef110baa002c232ac8f2c5f2
- StringAppendAndOverwrite() should always call StringResizeAndOverwrite()
with at least capacity() in case the standard library decides to shrink
the buffer (Fixes#1965)
- Small refactor to make the minimum growth an addition for clarity and
to make it easier to test 1.5x growth in the future
- Turn an ABSL_HARDENING_ASSERT into a ThrowStdLengthError
- Add a missing std::move
PiperOrigin-RevId: 826107106
Change-Id: I73ee3e98daa10161aa9023b2a879f6178ebedbcf
StringResizeAndOverwrite() but optimized for repeated appends, using
exponential growth to ensure amortized complexity of increasing
a string size by a small amount is O(1).
Use this function to replace STLStringResizeUninitializedAmortized()
PiperOrigin-RevId: 825100704
Change-Id: Ife64b13301bc4288d68154b7c496f57aaad4b6a4
StringResizeAndOverwrite has MSAN testing of the entire string.
This causes quadratic MSAN verification on small appends.
PiperOrigin-RevId: 824629932
Change-Id: Ibefff781f5923c8bd2c1dc364f5b63fcb1d0f5ab
StringResizeAndOverwrite() but optimized for repeated appends, using
exponential growth to ensure amortized complexity of increasing
a string size by a small amount is O(1).
Use this function to replace STLStringResizeUninitializedAmortized()
PiperOrigin-RevId: 824571998
Change-Id: I6fe4a9cadd469ceee6a3818d7b8709e2fa286b9c
/opt/llvm/clang/bin/clang -v
clang version 21.0.0git (https://github.com/llvm/llvm-project 2dee1a2de3d2cc774fbd43507cf4320418fbf279)
This change adds `-Wno-unused-command-line-argument`
to the Clang builds since Bazel is now providing an unused
`-c` to rules that do header syntax checking only.
Rules that were missing copts which causes them to
encounter this error are also fixed.
PiperOrigin-RevId: 764757573
Change-Id: I1eba676327a6023c5b8afb54499e4a3a72c2cdad
This change allows to reuse the conversion of `wchar_t` into UTF-8 from other code.
It also adds tests that covers the conversion.
PiperOrigin-RevId: 755365598
Change-Id: I0f1c0b7949dec3c9874be99f01540748436532ce
When a container or a string is mixed, size is only supplementary data.
We are still mixing size to avoid hash expansion to be a suffix of one another.
Mixing is done by addition `size + Seed()`. `+ Seed()` is needed to make an empty string to change the hash state. We assume that `Seed()` is already loaded to some register. Addition would modify low bits that will be spread with data mixing later.
We considered the following optimization. Mix the size at the beginning in order to improve the dependency graph. Mixing would happen in parallel with reading strings data. It's not feasible because absl::Hash API requires that hash expansions can't be suffixes of each other.
```
name old CYCLES/op new CYCLES/op delta
BM_latency_AbslHash_String3 27.2 ± 0% 21.5 ± 0% -21.08% (p=0.000 n=52+52)
BM_latency_AbslHash_String5 28.1 ± 8% 22.3 ±11% -20.70% (p=0.000 n=57+57)
BM_latency_AbslHash_String9 27.7 ± 9% 22.2 ±17% -19.77% (p=0.000 n=56+57)
BM_latency_AbslHash_String17 25.9 ± 5% 21.2 ±23% -18.02% (p=0.000 n=57+54)
BM_latency_AbslHash_String33 28.0 ± 5% 22.5 ± 4% -19.69% (p=0.000 n=54+54)
BM_latency_AbslHash_String65 37.9 ± 8% 32.2 ±10% -15.19% (p=0.000 n=52+53)
BM_latency_AbslHash_String257 57.1 ± 8% 52.0 ±10% -8.88% (p=0.000 n=52+54)
```
PiperOrigin-RevId: 750151406
Change-Id: I2245bad4906960d9236bea671738a218a85eb1af
* Fix many benchmarks to be cc_binary instead of cc_test
* Add a few benchmarks for StrFormat
* Add benchmarks for Substitute
* Add benchmarks for Damerau-Levenshtein distance used in flags
PiperOrigin-RevId: 738448552
Change-Id: I521f4b2ef9116c9895b44c32d27e94507380bee8
Now that Abseil only supports C++17 and beyond, these `base_internal` symbols [are just aliases](05e72a3285/absl/base/internal/invoke.h (L42)) in C++ >= 17. Replacing them in `Abseil`'s internals will allow us to delete `absl/base/internal/invoke.h`.
PiperOrigin-RevId: 726051909
Change-Id: Ic571307c6e11d7b3e2a380255bd4c9be98e232f9
There are a few different cases where we check iterator categorization, mostly for forward iterators for preallocating buffers of the correct size. Factoring this out makes it easier to make all of these cases support the C++20 iterator model.
PiperOrigin-RevId: 725791190
Change-Id: Icf9d687654618c7ceff98ec76ec59e83c682dd6b
Linux "latest" containers updated to
GCC 14.2
CMake 3.31.2
Bazel 8.0.0
Included are various fixes to get these versions to work.
Bazel now references repositories by their canonical names from the
Bazel Central Registry. For example, Abseil is now @abseil-cpp instead
of @com_google_absl, and GoogleTest is now @googletest instead of
@com_google_googletest. Users still using the old WORKSPACE system may
need to use `repo_mapping` on repositories using the old names. See
`WORKSPACE.bazel` in this commit for an example.
PiperOrigin-RevId: 709102146
Change-Id: I02327ed4f8fb947766480bdeef2b1930a7f831eb
This is portable because cord already has `operator<` etc., which will be unaffected. This just allows C++ >= 20 users to explicitly call `operator<=>`.
PiperOrigin-RevId: 646951415
Change-Id: I1432e224bd5dc09b99d56a1d27e95078463adf45
This helps compilers that understand `ABSL_ATTRIBUTE_LIFETIME_BOUND` flag constructs such as
`absl::StatusOr<std::string_view> str = std::string(...)`
as error-prone.
PiperOrigin-RevId: 621196818
Change-Id: I78d4c66854cde9d06eaaec05869d956376109d9c
Also updated the return value to reference to clarify non-nullability.
PiperOrigin-RevId: 602730828
Change-Id: Ia36f7fde3cc87ac597ba4f194eebe9ebb90a1a09