- 26 May, 2022 3 commits
-
-
PiperOrigin-RevId: 451201387 Change-Id: Ibeac4f24d00e28bbfc61e476936d669321a2cb24
Abseil Team committed -
Add implementation of is_invocable_r to absl::base_internal for C++ < 17, define it as alias of std::is_invocable_r when C++ >= 17 PiperOrigin-RevId: 451171660 Change-Id: I6dc0e40eabac72b82c4a19e292158e43118cb080
Dino Radakovic committed -
Benchmarks: https://pastebin.com/tZ7dr67W. Works well especially on smaller ranges. After a week on spending optimizing NEON SIMD where I almost managed to make hash tables work with NEON SIMD without performance hits (still 1 cycle to optimize and I gave up a little), I found an interesting optimization for aarch64 to use cls instruction (count leading sign bits). The loop has a property that ctrl_ group is not matched against count when the first slot is empty or deleted. ``` void skip_empty_or_deleted() { while (IsEmptyOrDeleted(*ctrl_)) { uint32_t shift = Group{ctrl_}.CountLeadingEmptyOrDeleted(); ctrl_ += shift; slot_ += shift; } ... } ``` However, `kEmpty` and `kDeleted` have format of `1xxxxxx0` and `~ctrl & (ctrl >> 7)` always sets the lowest bit to 1. In naive implementation, it does +1 to start counting zero bits, however, in aarch64 we may start counting one bits immediately. This saves 1 cycle and 5% of iteration performance. Then it becomes hard to find a supported and sustainable C++ version of it. `__clsll` is not supported by GCC and was supported only since clang 8, `__builtin_clrsb` is not producing optimal codegen for clang. `__rbit` is not supported by GCC and there is no intrinsic to do that, however, in clang we have `__builtin_bitreverse{32,64}`. For now I decided to enable this only for clang, only if they have appropriate builtins. PiperOrigin-RevId: 451168570 Change-Id: I7e9256a60aecdc88ced4e6eb15ebc257281b6664
Abseil Team committed
-
- 25 May, 2022 1 commit
-
-
Fixes #1181 ORIGINAL_AUTHOR=jerome.duval@gmail.com PiperOrigin-RevId: 451006334 Change-Id: Id61e5889fb55594d09e92e7bb98fdf8bfbc13cc4
Derek Mauro committed
-
- 24 May, 2022 1 commit
-
-
When building pkg-config files, compute linker flags with a string substitution rather than the JOIN generator expression. This ensures that commas in linker flags don’t get treated as argument separators in JOIN. Bug: https://bugs.debian.org/1011294 PiperOrigin-RevId: 450675966 Change-Id: I61eacc46a468bae5ff3dae2b437a564f2f1042c2
Benjamin Barenblat committed
-
- 23 May, 2022 2 commits
-
-
PiperOrigin-RevId: 450446058 Change-Id: I22a878bf04cf56b8a0e1dd049353acd2f6933828
Derek Mauro committed -
PiperOrigin-RevId: 450445030 Change-Id: I1c1e5ed67f81a181454f7fc6751bf42a3bc2bc48
Abseil Team committed
-
- 20 May, 2022 3 commits
-
-
See the GCC bug report https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105585 and Abseil bug report https://github.com/abseil/abseil-cpp/issues/1175 Fixes #1175 PiperOrigin-RevId: 450083136 Change-Id: I207aaffaec9166b335065dd6ef148a721b94048e
Derek Mauro committed -
Change workaround for MSVC bug regarding compile-time initialization to trigger from MSC_VER 1910 to 1930. 1929 is the last _MSC_VER for Visual Studio 2019. PiperOrigin-RevId: 449909831 Change-Id: Ibca931cc31131235eba55d2a1b97c7a062f059db
Abseil Team committed -
Previously was disabled on iPhone, but still enabled for macOS. The unscaled cycle clock does not work correctly when run on a VM. PiperOrigin-RevId: 449876559 Change-Id: I679ade90b43462e8d2794b1a2b32569d59029ed9
Tom Rybka committed
-
- 18 May, 2022 3 commits
-
-
This notably gets prefetch working on MSVC Implementation note: https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-prefetchcacheline MSVC does have PreFetchCacheLine, but that would require including <windows.h> in a header PiperOrigin-RevId: 449602543 Change-Id: I5e6ca4b7c3d287779aa03c2fd348b41fb65c3680
Derek Mauro committed -
Add a new (internal) feature test macro to detect whether the wrappers are no-ops on a given platform. Note that one-arg __builtin_prefetch(x) is equivalent to __builtin_prefetch(x, 0, 3), per `man BUILTIN_PREFETCH(3)` and gcc docs. PiperOrigin-RevId: 449508660 Change-Id: I144e750205eec0c956d8dd62bc72e10bdb87c4f7
Greg Falcon committed -
PiperOrigin-RevId: 449351955 Change-Id: Id30280107bb29f7d715327b99a2c954809513a48
Abseil Team committed
-
- 17 May, 2022 4 commits
-
-
Fixes #1167 PiperOrigin-RevId: 449328725 Change-Id: I813785db77b94efa49eeeff4c93449334c380935
Dino Radakovic committed -
raw_logging: Extract the inlined no-hook-registered behavior for LogPrefixHook to a default implementation. PiperOrigin-RevId: 449306617 Change-Id: Ia3e87d2edcae7e9874998f21a0e2ff245e48fd96
Andy Getzendanner committed -
Both Mutex and CondVar signal PerThreadSem/Waiter after satisfying the wait condition, as the result the waiting thread may return w/o waiting on the PerThreadSem/Waiter at all. If the waiting thread then exits, it currently destroys Waiter object. As the result Waiter::Post can be called on already destroyed object. PerThreadSem/Waiter must be type-stable after creation and must not be destroyed. The futex-based implementation is the only one that is not affected by the bug since there is effectively nothing to destroy (maybe only UBSan/ASan could complain about calling methods on a destroyed object). Here is the problematic sequence of events: 1: void Mutex::Block(PerThreadSynch *s) { 2: while (s->state.load(std::memory_order_acquire) == PerThreadSynch::kQueued) { 3: if (!DecrementSynchSem(this, s, s->waitp->timeout)) { 4: PerThreadSynch *Mutex::Wakeup(PerThreadSynch *w) { 5: ... 6: w->state.store(PerThreadSynch::kAvailable, std::memory_order_release); 7: IncrementSynchSem(this, w); 8: ... 9: } Consider line 6 is executed, then line 2 observes kAvailable and line 3 is not called. The thread executing Mutex::Block returns from the method, acquires the mutex, releases the mutex, exits and destroys PerThreadSem/Waiter. Now Mutex::Wakeup resumes and executes line 7 on the destroyed object. Boom! CondVar uses a similar pattern. Moreover the semaphore-based Waiter implementation is not even destruction-safe (the Waiter cannot be used to signal own destruction). So even if Mutex/CondVar would always pair Waiter::Post with Waiter::Wait before destroying PerThreadSem/Waiter, it would still be subject to use-after-free bug on the semaphore. PiperOrigin-RevId: 449159939 Change-Id: I497134fa8b6ce1294a422827c5f0de0e897cea31Abseil Team committed -
CondVar::WaitWithTimeout can live-lock when timeout is racing with Signal/SignalAll and Signal/SignalAll thread is not scheduled due to priorities, affinity or other scheduler artifacts. This could lead to stalls of up to tens of seconds in some cases. PiperOrigin-RevId: 449159670 Change-Id: I64bbd277c1f91964cfba3306ba8a80eeadf85f64
Abseil Team committed
-
- 16 May, 2022 1 commit
-
-
PiperOrigin-RevId: 449067700 Change-Id: I972b1736c28d76ed500e9ad6fd15c7a469a5825f
Abseil Team committed
-
- 13 May, 2022 1 commit
-
-
PiperOrigin-RevId: 448582508 Change-Id: I67fbff5f42a083e093ea2c20749e073ca03feb0b
Samuel Benzaquen committed
-
- 12 May, 2022 3 commits
-
-
PiperOrigin-RevId: 448361090 Change-Id: Iec6063b88a778dfe815081612650eaa456503265
Abseil Team committed -
Stop the absl::Cord destructor from running on the constinit cord in CordTest.ConstinitConstructor. This allows inspecting the cord at any point while the test is exiting, which is important for the semantics of the test. PiperOrigin-RevId: 448327386 Change-Id: Icef9faa2b63f1f0ae60b3430dcf6184f5dead885
Benjamin Barenblat committed -
PiperOrigin-RevId: 448159349 Change-Id: I6b25a90d8a3b6d3a888274d156aa696d77fb042d
Abseil Team committed
-
- 11 May, 2022 1 commit
-
-
PiperOrigin-RevId: 448075898 Change-Id: Ia4047f833bf27c62752b41f4ba65ab3be88a0181
Abseil Team committed
-
- 10 May, 2022 1 commit
-
-
* Avoid warnings due to deprecation of volatile return types. Also fix up optional_test.cc due to ABSL_USES_STD_OPTIONAL always being false in its body. Bug: chromium:1284275 PiperOrigin-RevId: 447796238 Change-Id: If050206c979c6c08af22e71ff0ea91e7f7932f0c
Abseil Team committed
-
- 05 May, 2022 2 commits
-
-
PiperOrigin-RevId: 446725910 Change-Id: I291fa8c1c41155b1530969f64b2b7f44b1576c92
Andy Getzendanner committed -
raw_logging: Rename SafeWriteToStderr to indicate what about it is safe (answer: it's async-signal-safe). Also, preserve errno across calls to make it actually signal-safe. PiperOrigin-RevId: 446620926 Change-Id: I875fbec02b909e8424ddf763303b0d6007f8548f
Andy Getzendanner committed
-
- 04 May, 2022 4 commits
-
-
Also note that this probe sequence visits every group exactly once. PiperOrigin-RevId: 446535602 Change-Id: I13169be3f8ee6a4ddbbe8be84f1e1a482444d0cc
Abseil Team committed -
Improve analysis of the number of extra `==` operations, which was overly complicated, slightly incorrect. The old analysis viewed it as birthday attack, which asks how often there are multiple values in the probe same probe sequence with the same H2. In their own words, this analysis "breaks down" at around `n = 12`. Instead we can answer a simpler question, which is, if a probe sequence examines `k` objects that are not what we are looking for, what's the number of calls `==`? The expectation is simply `k/128`. PiperOrigin-RevId: 446518063 Change-Id: Ie879bd4f6c97979822bc9d550b9e2503b1418c78
Abseil Team committed -
We also add accessors for rightmost()/mutable_rightmost(). PiperOrigin-RevId: 446515231 Change-Id: I4b8cb46f4bd209a0f51dcdcb96c9479e480828a3
Evan Brown committed -
PiperOrigin-RevId: 446476285 Change-Id: Ibd0913e06244424241200d17177a4f220fcb7861
Andy Getzendanner committed
-
- 03 May, 2022 2 commits
-
-
PiperOrigin-RevId: 446274314 Change-Id: Ibf641808c533a10e0aef8d1601095e539ae5c43a
Abseil Team committed -
PiperOrigin-RevId: 446209567 Change-Id: I9aac8ce10b93ed71f1260931995af1d32db6f780
Dino Radakovic committed
-
- 02 May, 2022 1 commit
-
-
PiperOrigin-RevId: 446010475 Change-Id: I28020510f3888a11f35b1960e9af441145ebf39b
Abseil Team committed
-
- 29 Apr, 2022 1 commit
-
-
PiperOrigin-RevId: 445394311 Change-Id: I265b6a83f79bbed4321e24e6da4730a2c43ddb07
Abseil Team committed
-
- 25 Apr, 2022 2 commits
-
-
Fixes #1159 PiperOrigin-RevId: 444278141 Change-Id: Iae055fe78b438c31150a9e7601b734f4981f002e
Derek Mauro committed -
PiperOrigin-RevId: 444259007 Change-Id: Ic518f66a33e387b7a551f37f7c0f6003c743dcb0
Abseil Team committed
-
- 22 Apr, 2022 2 commits
-
-
PiperOrigin-RevId: 443726104 Change-Id: Ibd015472fe3e403c2da49bdeeb365ca9a817b8a5
Dino Radakovic committed -
PiperOrigin-RevId: 443723710 Change-Id: Ic39b0cf2b289efa9cd9434616949dd08a1a35117
Abseil Team committed
-
- 21 Apr, 2022 1 commit
-
-
-- 6d4e969ad240d248bfeb644b3b76fffae0f07882 by Christian Blichmann <cblichmann@google.com>: cmake: Fix description of `ABSL_USE_EXTERNAL_GOOGLETEST` option There is no `add_subproject()` in CMake. PiperOrigin-RevId: 443087953 Change-Id: I30c2118638f99ad1389ae197e2c81d1e5f298882 GitOrigin-RevId: 6d4e969ad240d248bfeb644b3b76fffae0f07882
Abseil Team committed
-
- 19 Apr, 2022 1 commit
-
-
-- 6457ad659de86ce4cae1e9f7cb03a701c6c2851e by Abseil Team <absl-team@google.com>: Introduced ErrnoToStatusCode and ErrnoToStatus to abseil. PiperOrigin-RevId: 442903450 Change-Id: I9c062b34a3811216f43eef56e631eada3b4e3e84 GitOrigin-RevId: 6457ad659de86ce4cae1e9f7cb03a701c6c2851e
Abseil Team committed
-