- 05 Nov, 2024 1 commit
-
-
Add a comment explaining the extra comparison in raw_hash_set::operator==. Also add a small optimization to avoid the extra comparison in sets that use hash_default_eq as the key_equal functor. Note that removing the comparison entirely causes the Table.Equality2 test case to fail. PiperOrigin-RevId: 693447075 Change-Id: I769f75cf1cb27114455f1854e330c899cee55fc2
Evan Brown committed
-
- 04 Nov, 2024 2 commits
-
-
PiperOrigin-RevId: 692960029 Change-Id: I98252f2de95a237622ccf16f200bbb16dc441d88
Derek Mauro committed -
This install is conflicting with the manual one done after. It causes spurious recompilations for users as the original file is copied and then overwritten with each install. Fixes #1769 PiperOrigin-RevId: 692919849 Change-Id: I2fb9c68f6e547212425d5b5ae7205bbf19b46bf4
Florent Castelli committed
-
- 01 Nov, 2024 1 commit
-
-
This enables clang to catch more use-after-free bugs. PiperOrigin-RevId: 692275317 Change-Id: I86c414a90d24d239ed67b3316fe74e1c24f95ed9
Abseil Team committed
-
- 30 Oct, 2024 1 commit
-
-
PiperOrigin-RevId: 691547968 Change-Id: I41055f6840e7d08a5ba239f17e73632abc8f028d
Chris Kennelly committed
-
- 28 Oct, 2024 1 commit
-
-
`c_find_first_of` does not keep or return references into `options` so there's no reason to require an l-value there. PiperOrigin-RevId: 690696332 Change-Id: Ibbabb69ba72e9506c0406f2124034a944d6899d6
Abseil Team committed
-
- 23 Oct, 2024 5 commits
-
-
PiperOrigin-RevId: 689081310 Change-Id: I394b8eb6f87f3ea8e2ebce511baeef132b28d452
Abseil Team committed -
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1775 Win32 `dbhelp.h` defines `SYMBOL_INFO` structure under `WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)` guard. Any other partition will have these symbols undefined. Follow same logic in `symbolize.cc` to prevent compilation failure on non-Desktop platforms. Merge 0081212d7d6f40158157d616592633301437acb4 into 87831365 Merging this change closes #1775 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1775 from redbaron:patch-1 0081212d7d6f40158157d616592633301437acb4 PiperOrigin-RevId: 689022871 Change-Id: If68795b432b3d09b999aa52cb629c5ad2b6eb75c
Maxim Ivanov committed -
either the string ABSL_NAMESPACE_BEGIN or SKIP_ABSL_INLINE_NAMESPACE_CHECK A lot of files are currently missing one or the other. These will be updated when the files change (triggering the presubmit on the file) or though a followup mass update. PiperOrigin-RevId: 688985640 Change-Id: If2d3f3fcd6b41a7452198ba9de13c8633d6051c6
Derek Mauro committed -
PiperOrigin-RevId: 688971140 Change-Id: I11283c77c3df8fc9b964bfb58a46211b8783cdb4
Abseil Team committed -
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1777 This patch replaces all instances of std::ldexp(msb, 64) with msb * (2**64) as it turns out that this optimization is not done by MSVC. Worse, it emited a function call with error checking, even if the int128 cannot hit the inf limitation. Sadly even the constant `std::ldexp(1.0, 64)` is not inlined: https://gcc.godbolt.org/z/oGhGz77sx Merge a21b1c952494944e51e12c62127a71480bc28695 into 87831365 Merging this change closes #1777 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1777 from degasus:int128_t a21b1c952494944e51e12c62127a71480bc28695 PiperOrigin-RevId: 688968524 Change-Id: Id88cf38e241553f88bf4d97e7b001247dcd5599b
Markus Wick committed
-
- 22 Oct, 2024 1 commit
-
-
This allows containers that either optimize based on these concepts or produce lifetime warnings based on them to handle absl::Span appropriately. An example is Chromium's base::span, which warns more aggressively about construction from rvalues that are not borrowed ranges. This only has an effect for codebases using C++20. While many such codebases will presumably also be using std::span directly, they may use absl::Span for backwards compat, or compile against libraries that do so. Also fixes lint's that fired when I tried to edit this. PiperOrigin-RevId: 688552975 Change-Id: I603e04cd74d60ac6b65754ac73037d7f0ab457fe
Abseil Team committed
-
- 17 Oct, 2024 1 commit
-
-
PiperOrigin-RevId: 686814718 Change-Id: Ia712f4cd24ebf3d02fd0b03cd6973bb53e128682
Abseil Team committed
-
- 15 Oct, 2024 1 commit
-
-
PiperOrigin-RevId: 686110246 Change-Id: I78be07f1c6795d282c3739c54764b1562fd2523c
Gennadiy Rozental committed
-
- 14 Oct, 2024 1 commit
-
-
This fix increases the hash quality of these types. Also, make sure that absl::(u)int128 have the same hash expansion as their intrinsic counterparts. PiperOrigin-RevId: 685706878 Change-Id: Ib8e2e2b7a8ce24cf08f1e8d18094188a6eedbb3a
Samuel Benzaquen committed
-
- 11 Oct, 2024 1 commit
-
-
PiperOrigin-RevId: 684941948 Change-Id: I78a7ae6f4ec8f29e5bed414016eadf2ec95167a4
Abseil Team committed
-
- 10 Oct, 2024 2 commits
-
-
PiperOrigin-RevId: 684499936 Change-Id: Id5901d9d526abdf269f097a293bab6d08850d432
Evan Brown committed -
This is a followup to the [previous change](https://github.com/abseil/abseil-cpp/commit/69195d5bd2416a7224416887c78353ee8edf67ee) that added the `ABSL_NULLABILITY_COMPATIBLE` attribute macro. Adding these attributes has the following benefits: - Clang itself can now diagnose certain nullability errors through the `-Wnonnull` and `-Wnullability` warnings. - The nullability annotations can now also be used on pointers to incomplete types, as we have removed the `IsSupportedType` mechanism that used the `absl_nullability_compatible` tag to check whether a type is nullability-compatible (which only worked for complete types) and instead let Clang perform this check through the `ABSL_NULLABILITY_COMPATIBLE` attribute (which also works on incomplete types). PiperOrigin-RevId: 684342145 Change-Id: I94c8affd5be704cb49340058ced177f09ebd83a3
Martin Brænne committed
-
- 08 Oct, 2024 1 commit
-
-
PiperOrigin-RevId: 683715628 Change-Id: If73080e74c69523a458b2992c1f3740879ff097d
Evan Brown committed
-
- 02 Oct, 2024 2 commits
-
-
Also fix the old definition by verifying that the condition is contextually convertible to bool. The new C++20 definition reduces codegen bloat and guarantees fast performance while still retaining the expression (so that unused-variable warnings don't trigger). As an example where this makes a difference, compare the following snippet under `-DABSL_INTERNAL_CPLUSPLUS_LANG=202002`: https://godbolt.org/z/hjf59n84v ``` #include <stdlib.h> template<class T> struct S { S() { abort(); } static S const s; }; template<class T> S<T> const S<T>::s = {}; #if ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L #define ABSL_ASSERT(expr) (decltype((expr) ? void() : void())()) #else #define ABSL_ASSERT(expr) (false ? ((expr) ? void() : void()) : void()) #endif void foo() { ABSL_ASSERT(((void)&S<int>::s, true)); } ``` We see that, in unoptimized builds, code is still generated with the old definition of `ABSL_ASSERT`. Moreover, even under optimizations (with `-O2`), the call to abort() still lingers with the old definition of `ABSL_ASSERT`. Therefore the extra generated code can affect both compile- and run-time performance. PiperOrigin-RevId: 681563573 Change-Id: I7fbfadcc7fd198e8e1daf14615c33687f6b23af7
Abseil Team committed -
When Abseil hardening is enabled, this assertion's condition gets evaluated every time an iterator equality check is performed on iterators from a raw_hash_set. This occurs very frequently when looping over the contents of sets, due to loop conditions like `it != end()`, and causes about 0.4% CPU overhead to some Google workloads. PiperOrigin-RevId: 681560141 Change-Id: Ia0177cbef7cf67f9f0b6adf2cf55d9a2ed320d2d
Abseil Team committed
-
- 27 Sep, 2024 1 commit
-
-
sure MaskedPointer is trivially copyable and copy constructible. Fixes #1758 PiperOrigin-RevId: 679618900 Change-Id: Ia0ebacd8bb43b3fe3b9cd654259bef9072cec46c
Derek Mauro committed
-
- 26 Sep, 2024 1 commit
-
-
Saving one "&" operation in the Mutex::Unlock fast path. This has likely no performance impact (the two AND instructions ran in parallel anyway), but is as complex as the current solution, and enables two possible improvements in the future. 1. If bits Ev, Wr, Wa, De are made into the highest bits in the kMuLow, then the second "&" operation can be omitted because if kMuWriter is set, the there are no readers, so the kMuHigh bits are zero. 2. If the meanings of kMuWriter and kMuDesig are flipped, then the "^" operation is not needed either. PiperOrigin-RevId: 679272590 Change-Id: Iea7a04df0118d2410b7bfdab70b30e33d4b90e43
piotrzielinski committed
-
- 24 Sep, 2024 1 commit
-
-
- Compute the escape character values at compile time. - Use `little_endian::Store32` invariably to write all escaped characters. - Use 3 slop bytes at the end so that we can safely call `little_endian::Store32` at the end as well. PiperOrigin-RevId: 677995014 Change-Id: I9d710fff48d0ce0b013e64d726960364c77ea1d7
Shahriar Rouf committed
-
- 23 Sep, 2024 1 commit
-
-
to verify that AVX can be forced via `gnu::target`. Fixes #1759 PiperOrigin-RevId: 677853230 Change-Id: Ic69045c71ddf8230fd7b0210ba4aef8693053232
Derek Mauro committed
-
- 20 Sep, 2024 1 commit
-
-
PiperOrigin-RevId: 676894552 Change-Id: I68619a6ae48e65c7c58466b0be7ec79f5797066c
Evan Brown committed
-
- 19 Sep, 2024 2 commits
-
-
Fix benchmarks in `escaping_benchmark.cc` by properly calling `benchmark::DoNotOptimize` on both inputs and outputs and by removing the unnecessary and wrong `ABSL_RAW_CHECK` condition (`check != 0`) of `BM_ByteStringFromAscii_Fail` benchmark. Relevant comment: ``` // The DoNotOptimize(...) function can be used to prevent a value or // expression from being optimized away by the compiler. This function is // intended to add little to no overhead. // See: http://stackoverflow.com/questions/28287064 // // The specific guarantees of DoNotOptimize(x) are: // 1) x, and any data it transitively points to, will exist (in a register or // in memory) at the current point in the program. // 2) The optimizer will assume that DoNotOptimize(x) could mutate x or // anything it transitively points to (although it actually doesn't). // // To see this in action: // // void BM_multiply(benchmark::State& state) { // int a = 2; // int b = 4; // for (auto s : state) { // testing::DoNotOptimize(a); // testing::DoNotOptimize(b); // int c = a * b; // testing::DoNotOptimize(c); // } // } // BENCHMARK(BM_multiply); // // Guarantee (2) applied to 'a' and 'b' prevents the compiler lifting the // multiplication outside of the loop. Guarantee (1) applied to 'c' prevents the // compiler from optimizing away 'c' as dead code. ``` To see #1 and #2 in action, see: https://godbolt.org/z/ned1578ve PiperOrigin-RevId: 676588185 Change-Id: I7ed3e4bed8274b54ac7877316f2d82c33d68f00f
Shahriar Rouf committed -
PiperOrigin-RevId: 676486501 Change-Id: I874097a85486534150ce4c2f814d20be9d8b3b1f
Abseil Team committed
-
- 18 Sep, 2024 1 commit
-
-
Fix a bug in `absl::SetVLogLevel` where a less generic pattern incorrectly removed a more generic one. ### Example: The user passes `--vmodule=*pipeline*=10` to enable logs in files containing `"pipeline"` in their names: ``` pipeline_a.cc pipeline_b.cc pipeline_c.cc ``` Additionally, `pipeline_a.cc` executes `absl::SetVlogLevel("pipeline_a", 10)`. ### Expected behavior: VLOG level `10` is enabled in all files containing `"pipeline"` in their names. `absl::SetVlogLevel("pipeline_a", 10)` should not affect this, as `pipeline_a.cc` is already covered by `--vmodule=*pipeline*=10` and have the same level there. ### Actual behavior (before the CL): VLOG level `10` is enabled only in `pipeline_a.cc`. `--vmodule=*pipeline*=10` is ignored. ### Reason: `absl::SetVlogLevel` is based on `PrependVModuleLocked`. The issue lies in the following code within `PrependVModuleLocked`: ```cc // This is a memory optimization to avoid storing patterns that will never // match due to exit early semantics. Primarily optimized for our own unit // tests. get_vmodule_info().erase( std::remove_if(++iter, get_vmodule_info().end(), [module_pattern](const VModuleInfo& info) { return FNMatch(info.module_pattern, module_pattern); }), get_vmodule_info().cend()); ``` When `absl::SetVlogLevel("pipeline_a", 10)` is executed, `get_vmodule_info()` contains `"*pipeline*"`. Therefore, `info.module_pattern` equals to `"*pipeline*"` and `module_pattern` equals to `"pipeline_a"`. Because `"pipeline_a"` matches the pattern `"*pipeline*"`, the pattern `"*pipeline*"` is erroneously erased. `get_vmodule_info()` then only contains the `"pipeline_a"` pattern. ### Solution: This CL corrects the order of the arguments in `FNMatch` to: ```cc FNMatch(module_pattern, info.module_pattern); ``` This ensures that it correctly checks if the new pattern is more general than the previous pattern, but not vice versa. In the example above, the new pattern `"pipeline_a"` does not match the previous `"*pipeline*"` pattern. Therefore, `get_vmodule_info()` retains both patterns in the following order: `"pipeline_a"`, `"*pipeline*"`. PiperOrigin-RevId: 675776298 Change-Id: I9550dbd4282e66799619369894b8304856a7a777Alex Titov committed
-
- 17 Sep, 2024 5 commits
-
-
The original version of the tests did not reset the VLOG levels between tests, which could lead to false positives. This CL fixes the issue by resetting the VLOG levels to their default values before each test. PiperOrigin-RevId: 675711787 Change-Id: Id311ba0c00a9e929afcddc7346882487fd64ea16
Alex Titov committed -
The existing implementation uses wall-clock time. However, wall clock can drastically differ from the internal system clock, because the system can be suspended and then resumed. We want to account for at least some kinds of suspensions that might occur during automated testing, such as VM suspension or hypervisor preemption ("steal time"). These are tricky cases, because the physical (host) CPU is still running -- just the logical (guest) virtual CPU isn't. Therefore, we need to ensure that our time measurements exclude elapsed host-only time. Unfortunately the correctness of a method depends on the nature & configuration of each VM and the guest. For example, it can depend whether RDTSC is virtualized, or on whether the host and guest support accounting for steal time. Windows, for example, appears to only support steal time measurements if the hypervisor is Hyper-V. Since this is all for the sake of testing, we use a simpler trick that we hope will work around the problem on our systems: we subtract the so-called "interrupt time bias" from the system uptime in Windows. The interrupt time bias includes sleep/hibernation time, and seems to advance during for VM suspensions as well, so it may take care of the problem. PiperOrigin-RevId: 675654840 Change-Id: I66150b18912175fa72609d3f137e3ea4fee8fc43Abseil Team committed -
Add an explicit tag for non-SOO CommonFields (removing default ctor) and add a small optimization for early return in AssertNotDebugCapacity. PiperOrigin-RevId: 675640181 Change-Id: I5ab4cc6eaa0b54932ed70e42ed654f912cf1b099
Evan Brown committed -
Make moved-from swisstables behave the same as empty tables. Note that we may change this in the future. PiperOrigin-RevId: 675576092 Change-Id: Ibbe1d9d2b644ce6f6182a2d197635d6a0c5327f6
Evan Brown committed -
This is to prepare for continuous testing on darwin_arm64. PiperOrigin-RevId: 675532534 Change-Id: I58e183a3b8cac9cb73f1d0d56e9d41831f02488e
Abseil Team committed
-
- 16 Sep, 2024 4 commits
-
-
This is missing, which causes build-time breakages in cmake builds when gtest is directly included as part of the build's cmake tree. no_destructor_test directly `#include`s gmock. PiperOrigin-RevId: 675253814 Change-Id: Id9ce8b2935c526ea0bfca91590c23bbbcde05f9c
Abseil Team committed -
Optimize raw_hash_set moves by allowing some members of CommonFields to be uninitialized when moved-from. PiperOrigin-RevId: 675245694 Change-Id: I17b108703d8148dbf00e1683c937b50f09f79951
Evan Brown committed -
PiperOrigin-RevId: 675217344 Change-Id: Idfe8f1c91baa053d42b5f4e2f10cf745943d359c
Evan Brown committed -
PiperOrigin-RevId: 675191249 Change-Id: I8fde03e0db6e014853730d63fa1924fd2290bf3e
Evan Brown committed
-
- 13 Sep, 2024 1 commit
-
-
PiperOrigin-RevId: 674283690 Change-Id: I5ff9fd54af1175c2eb71fb942f10834f7be6bf9f
Abseil Team committed
-
- 12 Sep, 2024 1 commit
-
-
**Note**: These changes are generated by hand. Review with care. This CL changes the `absl_internal` implementations of `AsciiStrToLower()` / `AsciiStrToUpper()` to allow `src` to be null. This can, in fact, happen if the `string_view` passed to the public API is empty, and the implementations handle it correctly. I have added comments noting that `src` is allowed to be null iff the size is zero. `-Wnonnull` diagnoses cases where a `nullptr` literal is passed to a parameter annotated nonnull, or where `nullptr` is returned from a function whose return type is annotated nonnull. `-Wnullability` diagnoses cases where nullability annotations conflict, for example between the declaration and definition of a function. PiperOrigin-RevId: 673846759 Change-Id: I6cf3490ce13837eba9814156c420598000ecc596
Martin Brænne committed
-