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
`std::monostate` is a struct without any fields thus there is no content to be printed at all. However, the default printer prints it as `"unprintable value of size 1 @{some address}"` which is not very useful unless we're really interested in the address of struct having nothing.
PiperOrigin-RevId: 906966193
Change-Id: I7121bd9d58ac9930fa19432d76788d1df6dc5b78
This will let us deprecate the declarations without triggering warnings in Abseil itself.
PiperOrigin-RevId: 906360966
Change-Id: Iee362ac0eac647909ef38003280f1179813f764d
be exported. The one function that is currently using it is easily
implemented with absl::Base64Escape().
PiperOrigin-RevId: 900830658
Change-Id: I859d67efafd5ba96921bb75c9207438975d055d6
Most usages of absl::void_t compile fine with std::void_t, so we migrate them here. A few don't compile due to overly eager template instantiations, so we leave those.
PiperOrigin-RevId: 897231619
Change-Id: Iad34101916dac2b995257ebd5d6aacb9a0acfa32
This will let us deprecate the declarations without triggering warnings in Abseil itself.
PiperOrigin-RevId: 895480358
Change-Id: I2e15877c15ed83f48ddb68cc73344c14b533bc68
This will let us deprecate the declarations without triggering warnings in Abseil itself.
PiperOrigin-RevId: 894202105
Change-Id: I57bb2a1647be1fedf9b724a07042fd0f564ce074
When falling back to resize(), the entire resized block gets
initialized, which causes pathological behavior in the case of many
small appends. reserve() fixes this problem.
PiperOrigin-RevId: 877497660
Change-Id: I3ae8b45d74a62f975b1050851fe6fd9561071bec
When using the fallback, resize() is used, which initializes the
entire block, which causes pathological behavior in the case of many
small appends.
PiperOrigin-RevId: 877019230
Change-Id: If685b888ba55233c3c7436a6af19333561308424
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
This library contains helper functions that allow throwing exceptions
consistently from anywhere, without risk of ODR violations. When
execptions are disabled, these functions abort the program.
The old internal spellings will be removed in a follow up change.
PiperOrigin-RevId: 867594519
Change-Id: Ibd7a447f5577247bced718617f5da662d983d185
StringResizeAndOverwriteImpl()
This change bridges the gap between the legacy uninitialized resize
behavior and the modern absl::StringResizeAndOverwrite(). The internal
StringResizeAndOverwriteImpl function is used directly because the
public Abseil API requires the buffer to be initialized, whereas these
legacy functions rely on the behavior of leaving it uninitialized
(which is technically UB but relied upon here).
This is part of the work to migrate away from these legacy
utilities.
PiperOrigin-RevId: 855779916
Change-Id: If22484048024eae8ddedd29ebb08e8884e0198a3
- 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
We both call DecrementExpectHighRefcount which assumes ref>1,
and we PREDICT_FALSE that it's 1.
PiperOrigin-RevId: 789316655
Change-Id: Icbb1586d91a34f8c02b2ce1341af3c36c8837c80
argument.
This is already undefined behavior since the argument is immediately
used to construct a string_view, and passing a null argument to the
single-arg string_view constructor is undefined behavior. Adding the
check will prevent introduction of new bugs when using standard
library implementations that do not detect this case.
PiperOrigin-RevId: 787676394
Change-Id: Ia3e069071e28c8e17df956b8b713bf17fb1e3be3
the Clang version used in the Linux ARM CI to Clang 19.
nullability-completeness is an all-or-nothing warning, and it is
enabled by default. If anything is annotated, everything has to be
annotated.
There are a few types of fixes in this change. The most common is just
to add missing annotations. In a few cases, some SFINAE methods are
changed not to use pointers at all. In some cases, like
cord_internal.h, I removed the single annotation as that is easier
than doing the entire complicated file for now. cordz_test_helpers.h
uses GoogleTest macros, which bring in pointers that can't easily be
annotated, so I removed the annotations from this file as well.
Tests are also opted-out of the warning.
I'm not sure why the x86 Clang version didn't pick these issues up.
PiperOrigin-RevId: 755844859
Change-Id: I7d7f4cc4f6d779f52c86a4d96e07880341244491
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