summaryrefslogtreecommitdiff
path: root/absl
Commit message (Collapse)AuthorAge
* Roll forward poisoned pointer API and fix portability issues.Gravatar Evan Brown2024-07-10
| | | | | | | Also, return the middle of the poisoned block. PiperOrigin-RevId: 651119057 Change-Id: Iae0fc3dcb40e32cd449f469d9b8d62c37f3773f4
* Use GetStatus in IsOkAndHoldsMatcherGravatar Laramie Leavitt2024-07-10
| | | | | PiperOrigin-RevId: 651093644 Change-Id: Ia5bb3343ef06529d5fa2d469bcad47451ea79c69
* PR #1707: Fixup absl_random compile breakage in Apple ARM64 targetsGravatar Soo-Hwan Na2024-07-10
| | | | | | | | | | | | | | | | Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1707 Switched to append a full string of "-Xarch_x86_64 -maes" instead of " -Xarch_x86_64" "-maes", for example. Now cmake correctly appends -Xarch_x86_64 to each x64 specific compile option, removing the error caused in recent clang releases: clang++: error: unsupported option '-msse4.1' for target 'arm64-apple-darwin23.5.0' Merge 83d17537ee70158d627681a0f0c15f15f30ef838 into f46495ea96f68fc3f6c394f099b2992743f6ff7f Merging this change closes #1707 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1707 from Royna2544:patch-1 83d17537ee70158d627681a0f0c15f15f30ef838 PiperOrigin-RevId: 651046496 Change-Id: Ifdb3848febeead4fb562a2d9f0fdca2e0aea185d
* Add an MSVC implementation of ABSL_ATTRIBUTE_LIFETIME_BOUNDGravatar Derek Mauro2024-07-07
| | | | | | | https://learn.microsoft.com/en-us/cpp/code-quality/c26816?view=msvc-170 PiperOrigin-RevId: 650044473 Change-Id: I2bf31f1e4b972e890194d21c5a6dcb4ee9993484
* Mark c_min_element, c_max_element, and c_minmax_element as constexpr in C++17.Gravatar Abseil Team2024-07-03
| | | | | | | This allows them to be used in constant expressions, such as static_asserts. PiperOrigin-RevId: 649292841 Change-Id: I76e31a94b933fa357276fee534b81c00c28c8b23
* Optimize the absl::GetFlag cost for most non built-in flag types (including ↵Gravatar Gennadiy Rozental2024-07-03
| | | | | | | string). PiperOrigin-RevId: 649200175 Change-Id: Ic6741d9fe5e0b1853ed8bb37b585d38b51d15581
* Encode some additional metadata when writing protobuf-encoded logs.Gravatar Andy Getzendanner2024-07-03
| | | | | PiperOrigin-RevId: 649138261 Change-Id: I8687eb7b06cc9e96779d1d3e98b44b4f643c95a8
* Replace signed integer overflow, since that's undefined behavior, with ↵Gravatar Abseil Team2024-07-02
| | | | | | | unsigned integer overflow. PiperOrigin-RevId: 648730502 Change-Id: I662c365c59be9e51f565fd215d284a96b7bd8743
* Make mutable CompressedTuple::get() constexpr.Gravatar Abseil Team2024-07-01
| | | | | | | | This change makes the mutable overloads of CompressedTuple::get() constexpr. This is consistent with std::get(std::tuple), which is constexpr since C++14. PiperOrigin-RevId: 648603141 Change-Id: Icbd61809f7a06723cf581dbed5488b7bae998cc9
* vdso_support: support DT_GNU_HASHGravatar Fangrui Song2024-07-01
| | | | | | | | | | | This library provides `LookupSymbol` and `LookupSymbolByAddress`. The latter needs `GetNumSymbols` support. An object file needs either .hash (DT_HASH) or .gnu.hash (DT_GNU_HASH). This patch adds DT_GNU_HASH support. Note: glibc has been supporting DT_GNU_HASH since 2006 and .hash has been quite obsoleted in the Linux communities. PiperOrigin-RevId: 648459622 Change-Id: I3aa1274cd4617990844258175715e3be2343afd2
* Make c_begin, c_end, and c_distance conditionally constexpr.Gravatar Abseil Team2024-07-01
| | | | | | | | | | | | | This allows them to be used in constexpr expressions, such as the following: ``` constexpr int distance = absl::c_distance(std::array<int, 3>()); ``` Requires at least C++17 to be constexpr. PiperOrigin-RevId: 648435141 Change-Id: I8136e351a6dc4c25f06ef895fb449f4f11048480
* Add operator<=> comparison to absl::Time and absl::Duration.Gravatar Charlie Beattie2024-07-01
| | | | | PiperOrigin-RevId: 648433954 Change-Id: I32e47a89685419ae8d37dfadb354cfaab2a35ae9
* Deprecate `ABSL_ATTRIBUTE_NORETURN` in favor of the `[[noreturn]]`Gravatar Derek Mauro2024-07-01
| | | | | | | | | | | | | | | standardized in C++11 Migrate all Abseil code to `[[noreturn]]`. Notably, https://github.com/abseil/abseil-cpp/issues/1698 reports that `[[noreturn]]` works better here. We can't migrate `ABSL_ATTRIBUTE_NORETURN` to use `[[noreturn]]` because the difference in accepted attribute placement breaks some code. PiperOrigin-RevId: 648395324 Change-Id: Icd3e9b837aac25f128e8994de099f1edb3cabccf
* Rollback new poisoned pointer APIGravatar Derek Mauro2024-07-01
| | | | | | | | | This breaks Chromium due to global constructor and incorrectly assumes page size. https://github.com/abseil/abseil-cpp/pull/1697 PiperOrigin-RevId: 648377066 Change-Id: I19f8b2655971a0c314091e26e62e10a5a9c46e94
* Static cast instead of reinterpret cast raw hash set slots as casting from ↵Gravatar Abseil Team2024-07-01
| | | | | | | void* to T* is well defined PiperOrigin-RevId: 648352837 Change-Id: I082cd0c007706ae8baa8f26cdc85d51b69bffd54
* Fix absl::NoDestructor documentation about its use as a globalGravatar Derek Mauro2024-06-27
| | | | | | | | | It is not possible to have a constant-initialized object of type absl::NoDestructor<T>. Fix the documentation so that it doesn't mention this possibility. Only recommend it use as a function-scope static variable, and discourage its use as a global variable. PiperOrigin-RevId: 647488395 Change-Id: Ifee052fce07609d3de72cddc30e86de67706cd91
* Declare Rust demangling feature-complete.Gravatar Chris Mihelich2024-06-27
| | | | | PiperOrigin-RevId: 647417773 Change-Id: I7d945ae27199262b3baf83b232d17c2f641a27ac
* Split demangle_internal into a tree of smaller libraries.Gravatar Chris Mihelich2024-06-27
| | | | | PiperOrigin-RevId: 647359155 Change-Id: I5aba1169b01a74c4431f5ee3788b490124eeaa65
* Decode Rust Punycode when it's not too long.Gravatar Chris Mihelich2024-06-27
| | | | | PiperOrigin-RevId: 647340145 Change-Id: I4b0076595dbda1f81ffdc32adad2dc1e35cb9e04
* Add assertions to detect reentrance in `IterateOverFullSlots` and ↵Gravatar Vitaly Goldshteyn2024-06-27
| | | | | | | | | `absl::erase_if`. Since we have potential plans to use this function more widely including `absl::c_for_each`, we need to have good error detection. PiperOrigin-RevId: 647236725 Change-Id: I5035bfb8cef24f80f1bbed83a42380e57d84e428
* Decoder for Rust-style Punycode encodings of bounded length.Gravatar Chris Mihelich2024-06-26
| | | | | PiperOrigin-RevId: 647093624 Change-Id: Ic76bfa4aa8fb616cb23095ce7bfa30c3812dcb21
* Add `c_contains()` and `c_contains_subrange()` to `absl/algorithm/container.h`.Gravatar Abseil Team2024-06-26
| | | | | | | These functions are based on the C++23's `std::ranges::contains()` and `std::ranges::contains_subrange()` functions, see: https://en.cppreference.com/w/cpp/algorithm/ranges/contains PiperOrigin-RevId: 647084955 Change-Id: If5a01784e3cf1cc4d88e7f2fef92a3701fafc886
* Three-way comparison spaceship <=> operators for Cord.Gravatar Abseil Team2024-06-26
| | | | | | | 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
* internal-only changeGravatar Abseil Team2024-06-26
| | | | | PiperOrigin-RevId: 646949076 Change-Id: I0d3fc57aee38e5b3a5b85e2301f5035bfd0e388b
* Remove erroneous preprocessor branch on SGX_SIM.Gravatar Evan Brown2024-06-25
| | | | | PiperOrigin-RevId: 646614152 Change-Id: Iee853bdc6f753d758c850a529a6adb05d0d0b1a7
* Add an internal API to get a poisoned pointer.Gravatar Evan Brown2024-06-24
| | | | | | | The motivation is to make destroyed/moved-from objects cause crashes when they are accessed. PiperOrigin-RevId: 646229564 Change-Id: I68d9c189b542df0933af08f5ad63dc1f5764d856
* optimization.h: Add missing <utility> header for C++Gravatar Abseil Team2024-06-24
| | | | | PiperOrigin-RevId: 646172195 Change-Id: I089f1d84f2d73b663f12e6818f96436e054e71ae
* Add a compile test for headers that require C compatibilityGravatar Derek Mauro2024-06-24
| | | | | | | | windows_clangcl_bazel.bat includes a change from --copt to --cxxopt to only pass /std:c++XX to C++ compiles PiperOrigin-RevId: 646157298 Change-Id: Ib6d9861a2b2d45eb0d664f23b6f3a7426f8e0ab3
* Fix comment typoGravatar Anthony Lai2024-06-24
| | | | | PiperOrigin-RevId: 646105357 Change-Id: Ia76c1ce33faf811e988d36747f187c112ccb967e
* Expand documentation for SetGlobalVLogLevel and SetVLogLevel.Gravatar Tanvi Jagtap2024-06-24
| | | | | PiperOrigin-RevId: 646031348 Change-Id: I212e34a0b89293bd9f0081047bb5a1eba5d04bcb
* Roll back 6f972e239f668fa29cab43d7968692cd285997a9Gravatar Abseil Team2024-06-22
| | | | | | | | `optimization.h` needs to be compatible with C. `#include <utility>` is C++-only. PiperOrigin-RevId: 645651894 Change-Id: I55ebc3369b05788346cd0ab684b50bdfc2345fd4
* PR #1692: Add missing `<utility>` includeGravatar Patrick O'Connell2024-06-22
| | | | | | | | | | | | | Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1692 `optimization.h` uses `std::unreachable()` if available but does not include `<utility>`, causing errors in `absl/strings/ascii.cc`. Merge bf912bb4e38341d6152ee145ec2be00251c42552 into 8a28a0c8732ba3bf0191fb6292fcad6e5948a047 Merging this change closes #1692 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1692 from poconn:optimization_missing_include bf912bb4e38341d6152ee145ec2be00251c42552 PiperOrigin-RevId: 645643983 Change-Id: I3966984afa81f2f6bce65dd872d326f0af114bfa
* Remove NOLINT for `#include <new>` for __cpp_lib_launderGravatar Vitaly Goldshteyn2024-06-21
| | | | | PiperOrigin-RevId: 645286828 Change-Id: I00efdf1bf774daafbd34c898cf4a524852b638e0
* Remove not used after all kAllowRemoveReentrance parameter from ↵Gravatar Vitaly Goldshteyn2024-06-20
| | | | | | | | | IterateOverFullSlots. We decided to not allow reentrance in absl::erase_if and absl::container_internal::c_for_each_fast. PiperOrigin-RevId: 645273965 Change-Id: I75dfc73b93ba10f0e051bf0833723af887e1bb36
* Create `absl::container_internal::c_for_each_fast` for SwissTable.Gravatar Vitaly Goldshteyn2024-06-20
| | | | | | | | | | | | | | | | | | This function is aimed to achieve faster iteration through the entire hash table. It is not ready to be used by the public and stays in `container_internal` namespace. Differences with `absl::c_for_each`: 1. No guarantees on order of iteration. Although for the hash table it is partially not guaranteed already. But we do not even guarantee that it is the same order as in the for loop range. De facto, the order is the same at the moment. 2. No mutating reentrance is allowed. Most notably erasing from the hash_table is not allowed. Based on microbenchmarks, there are following conclusions: 1. c_for_each_fast is clearly faster on big tables with 20-60% speedup. 2. Microbenchmarks show regression on a full small table without any empty slots. We should avoid recommending that for small tables. 3. It seems reasonable to use `c_for_each_fast` in places, where `skip_empty_or_deleted` has significant GCU usage. `skip_empty_or_deleted` usage signals that there are "gaps" between elements, so `c_for_each_fast` should be an improvement. PiperOrigin-RevId: 645142512 Change-Id: I279886b8c8b2545504c2bf7e037d27b2545e044d
* Disable flaky test cases in kernel_timeout_internal_test.Gravatar Evan Brown2024-06-20
| | | | | PiperOrigin-RevId: 645054874 Change-Id: Ic4a820b47edfa71bd3e1f149d54f00ac3c1d16a6
* Document that swisstable and b-tree containers are not exception-safe.Gravatar Evan Brown2024-06-20
| | | | | | | For performance reasons, these containers are optimized for the case in which allocations/deallocations/comparisons/hashers can't throw exceptions. PiperOrigin-RevId: 645054627 Change-Id: I99be651b26f5bbb87da6ef246b92b20a375224d7
* Add `ABSL_NULLABILITY_COMPATIBLE` attribute.Gravatar Martin Brænne2024-06-17
| | | | | | | | | | | | | | | | This is a replacement for the `absl_nullability_compatible` tag. The attribute has the advantage that, unlike the tag, it can be applied to forward declarations. This does not yet change the implementation of the nullability annotations -- that will come in a followup patch. As the nullability annotations themselves have not been changed, the `absl_nullability_compatible` tag is currently still used to check whether the annotations can be applied to a given type; see also the comments in the code. PiperOrigin-RevId: 644238698 Change-Id: I5882606f82ce7a6dd98e83e6d920573437561b50
* LSC: Move expensive variables on their last use to avoid copies.Gravatar Abseil Team2024-06-17
| | | | | PiperOrigin-RevId: 644150551 Change-Id: I11f3f8463fcfdb8d0284b1ab320624bbce6d1e48
* Add ABSL_INTERNAL_ATTRIBUTE_VIEW and ABSL_INTERNAL_ATTRIBUTE_OWNER ↵Gravatar Abseil Team2024-06-17
| | | | | | | attributes to more types in Abseil PiperOrigin-RevId: 643946867 Change-Id: Ia4fb583872dabd72c48cc4c20fe23a64dea517a6
* Drop std:: qualification from integer types like uint64_t.Gravatar Chris Mihelich2024-06-14
| | | | | PiperOrigin-RevId: 643418422 Change-Id: Ib16cfef8ddedc8366df49ca75ab02eb60af08f26
* Increase slop time on MSVC in PerThreadSemTest.Timeouts again due to ↵Gravatar Evan Brown2024-06-14
| | | | | | | continued flakiness. PiperOrigin-RevId: 643372086 Change-Id: I8fb2acc0e5ad35113e865bf008a531f3442a9295
* Turn on validation for out of bounds MockUniform in MockingBitGenGravatar Justin Bassett2024-06-13
| | | | | | | | | | | | | | | | | | | | | | | | | This makes MockUniform fail if the action is specified to return an out of bounds value. Examples that will fail: absl::Uniform(gen, 1, 4) -> 42 absl::Uniform(gen, 1, 4) -> 4: [1, 4) absl::Uniform(absl::IntervalOpenClosed, gen, 1, 4) -> 1: (1, 4] Examples that will pass: absl::Uniform(gen, 1, 4) -> 3 absl::Uniform(gen, 1, 4) -> 1: [1, 4) absl::Uniform(absl::IntervalClosed, gen, 1, 4) -> 4: [1, 4] Special case: the empty range always returns its boundary, so this case passes: absl::Uniform(absl::IntervalOpen, 1, 1) -> 1: (1, 1) If this breaks your test, your test has a bug: it's relying on an absl::Uniform() call that returns an impossible value. The UnvalidatedMockingBitGen type temporarily exists to allow for disabling the validation to give a bit of time to fix the test, but this type will go away soon. PiperOrigin-RevId: 643090275 Change-Id: I23470fa9e1efbcb42fa3866237038414545c7be2
* Use ABSL_UNREACHABLE() instead of equivalentGravatar Derek Mauro2024-06-13
| | | | | PiperOrigin-RevId: 643024432 Change-Id: Id07aa18d186291442f7b6f3c68ef8dd6cc20b434
* If so configured, report which part of a C++ mangled name didn't parse.Gravatar Chris Mihelich2024-06-12
| | | | | PiperOrigin-RevId: 642757934 Change-Id: I6dffe81e5173201b80a107b951fe1c69b20972f5
* Sequence of 1-to-4 values with prefix sum to support Punycode decoding.Gravatar Chris Mihelich2024-06-12
| | | | | PiperOrigin-RevId: 642696557 Change-Id: Ia6b8e174ddb55e44bd082bf0d81d2f9c53c94016
* Add the missing inline namespace to the nullability filesGravatar Derek Mauro2024-06-12
| | | | | PiperOrigin-RevId: 642621989 Change-Id: I95efa4bd9fe8fe3c449304706401374f851f0fbe
* Add ABSL_INTERNAL_ATTRIBUTE_VIEW and ABSL_INTERNAL_ATTRIBUTE_OWNER ↵Gravatar Abseil Team2024-06-12
| | | | | | | attributes to types in Abseil PiperOrigin-RevId: 642619703 Change-Id: I8d2e423a3c7f40709d0e8c82cac0395c75d601cf
* Disallow reentrance removal in `absl::erase_if`.Gravatar Vitaly Goldshteyn2024-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Predicates should generally have no side effects since we do not guarantee the order or quantity for the calls. In this change we forbid one specific side effect: modification of the table we are iterating over. As a positive effect we have performance improvements (less computations and less branches). ``` name old cpu/op new cpu/op delta BM_EraseIf/num_elements:10/num_erased:0 3.02ns ± 2% 2.79ns ± 3% -7.44% (p=0.000 n=35+37) BM_EraseIf/num_elements:1000/num_erased:0 2.41ns ± 5% 2.05ns ± 4% -14.88% (p=0.000 n=37+37) BM_EraseIf/num_elements:10/num_erased:5 4.40ns ± 3% 4.22ns ± 3% -4.19% (p=0.000 n=37+37) BM_EraseIf/num_elements:1000/num_erased:500 9.16ns ± 4% 9.13ns ± 3% ~ (p=0.307 n=37+37) BM_EraseIf/num_elements:10/num_erased:10 5.77ns ± 3% 5.50ns ± 4% -4.62% (p=0.000 n=37+37) BM_EraseIf/num_elements:1000/num_erased:1000 7.84ns ± 3% 7.77ns ± 3% -0.94% (p=0.006 n=37+35) name old time/op new time/op delta BM_EraseIf/num_elements:10/num_erased:0 3.02ns ± 2% 2.79ns ± 3% -7.48% (p=0.000 n=35+36) BM_EraseIf/num_elements:1000/num_erased:0 2.41ns ± 5% 2.05ns ± 4% -14.89% (p=0.000 n=37+37) BM_EraseIf/num_elements:10/num_erased:5 4.42ns ± 3% 4.23ns ± 3% -4.22% (p=0.000 n=37+37) BM_EraseIf/num_elements:1000/num_erased:500 9.18ns ± 4% 9.15ns ± 3% ~ (p=0.347 n=37+37) BM_EraseIf/num_elements:10/num_erased:10 5.79ns ± 3% 5.52ns ± 4% -4.61% (p=0.000 n=37+37) BM_EraseIf/num_elements:1000/num_erased:1000 7.87ns ± 3% 7.79ns ± 3% -0.95% (p=0.007 n=37+35) name old INSTRUCTIONS/op new INSTRUCTIONS/op delta BM_EraseIf/num_elements:10/num_erased:0 14.9 ± 0% 12.9 ± 0% -13.46% (p=0.000 n=37+37) BM_EraseIf/num_elements:1000/num_erased:0 12.7 ± 0% 10.3 ± 0% -18.76% (p=0.000 n=37+37) BM_EraseIf/num_elements:10/num_erased:5 30.9 ± 0% 28.9 ± 0% -6.48% (p=0.000 n=37+37) BM_EraseIf/num_elements:1000/num_erased:500 37.6 ± 0% 35.3 ± 0% -6.33% (p=0.000 n=37+37) BM_EraseIf/num_elements:10/num_erased:10 46.9 ± 0% 44.9 ± 0% -4.27% (p=0.000 n=37+37) BM_EraseIf/num_elements:1000/num_erased:1000 62.6 ± 0% 60.2 ± 0% -3.80% (p=0.000 n=37+36) name old CYCLES/op new CYCLES/op delta BM_EraseIf/num_elements:10/num_erased:0 4.91 ± 1% 4.11 ± 1% -16.35% (p=0.000 n=36+35) BM_EraseIf/num_elements:1000/num_erased:0 7.74 ± 2% 6.54 ± 2% -15.54% (p=0.000 n=37+37) BM_EraseIf/num_elements:10/num_erased:5 9.18 ± 3% 8.45 ± 3% -7.88% (p=0.000 n=37+35) BM_EraseIf/num_elements:1000/num_erased:500 29.5 ± 1% 29.3 ± 1% -0.82% (p=0.000 n=36+37) BM_EraseIf/num_elements:10/num_erased:10 13.5 ± 1% 12.6 ± 0% -7.06% (p=0.000 n=33+34) BM_EraseIf/num_elements:1000/num_erased:1000 25.1 ± 0% 24.9 ± 0% -0.90% (p=0.000 n=37+35) ``` PiperOrigin-RevId: 642318040 Change-Id: I78a4a5a9a5881db0818225f9c7c153c562009f66
* Fix implicit conversion of temporary bitgen to BitGenRefGravatar Abseil Team2024-06-10
| | | | | | | There is no reason a temporary *shouldn't* be usable with BitGenRef (indeed, ABSL_ATTRIBUTE_LIFETIME_BOUND should catch errors) and it is useful when passing a temporary bitgen as an input argument. PiperOrigin-RevId: 642021132 Change-Id: I03e46f5f437e40a0c6225ea1f0361475a3501513