summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* CMake: add option to use Google Test already installed on system (#969)Gravatar Florin Crișan2021-06-09
| | | As of this change, you can use `-DABSL_USE_EXTERNAL_GOOGLETEST=ON -DABSL_FIND_GOOGLETEST=ON` to have Abseil use the standard CMake find_package(GTest) mechanism.
* Export of internal Abseil changesGravatar Abseil Team2021-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | -- 72ce5b636488f17753d110ec18f57132d6180db3 by Derek Mauro <dmauro@google.com>: Update GoogleTest version used by Abseil PiperOrigin-RevId: 378296419 -- 1eaa36f65315a1cb95c95dfee0bc31307d280d18 by Abseil Team <absl-team@google.com>: Define unary + operators for absl::int128 and absl::uint128. These are rarely used but apparently missing. PiperOrigin-RevId: 377975179 -- 1a029d6ff8f9e21ddf0b89949be04c0a56661359 by Abseil Team <absl-team@google.com>: Remove gratuitous reinterpret_cast. PiperOrigin-RevId: 377894806 GitOrigin-RevId: 72ce5b636488f17753d110ec18f57132d6180db3 Change-Id: I8a06f69b3489c9aef8260fd271bde2a55f01807f
* Export of internal Abseil changesGravatar Abseil Team2021-06-03
| | | | | | | | | | | | | | | | | | -- 066144400e12616f6771e512427bcd98aa203455 by Abseil Team <absl-team@google.com>: Internal comment cleanup. PiperOrigin-RevId: 377368470 -- 3ba56d263bd90a9797d12b5ce29edce3fa65917c by Abseil Team <absl-team@google.com>: Add tests for hash table capacity being unchanged by insert. PiperOrigin-RevId: 377303140 GitOrigin-RevId: 066144400e12616f6771e512427bcd98aa203455 Change-Id: I2edf14b412e45a2ad490dcf9f06e009c12a60e3e
* Export of internal Abseil changesGravatar Abseil Team2021-06-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- b2a781121ff72fb485b7e67539d5e4ff1eb66df2 by Gennadiy Rozental <rogeeff@google.com>: Consistently use absl::flat_hash_map instead of std::map in Flags implementation. PiperOrigin-RevId: 377132816 -- 9ab83a154d8f22d51fed0092bf94245b5af1f498 by Derek Mauro <dmauro@google.com>: Workaround for MSAN being unable to see through getentropy(). https://github.com/google/sanitizers/issues/1173 PiperOrigin-RevId: 377097059 -- 8d28e921442d1b246c26f3200f21027557c47657 by Greg Falcon <gfalcon@google.com>: Disable stack_consumption_test in tsan builds. A recent tsan change broke the way this test-only utility was counting stack usage. PiperOrigin-RevId: 377053169 GitOrigin-RevId: b2a781121ff72fb485b7e67539d5e4ff1eb66df2 Change-Id: Ib56356f8128f6c083f32b950091f3a56d9e2cd51
* Export of internal Abseil changesGravatar Abseil Team2021-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 2c81c02d2b68303134e777f31921679ab87a2639 by Derek Mauro <dmauro@google.com>: Use getentropy() to get seed material when using glibc >= 2.25 getentropy() uses the getrandom syscall on Linux to avoid file descriptors. It is never interputed (EINTR) and uses the same source as /dev/urandom. https://man7.org/linux/man-pages/man3/getentropy.3.html getrandom has been in the Linux since kernel 3.17 When unavailable (ENOSYS), fallback to /dev/urandom. PiperOrigin-RevId: 376962620 -- 81cd41372a04eda400a2e3be53c239c0dac6bdf3 by Abseil Team <absl-team@google.com>: Make FunctionRef no longer have -Wdeprecated-copy warnings from Clang by defaulting the copy constructor. This is needed because the assignment operator is deleted. Fixes #948 PiperOrigin-RevId: 376928548 GitOrigin-RevId: 2c81c02d2b68303134e777f31921679ab87a2639 Change-Id: I0abb18052ffff5dd1448f0b68edbb668045335f0
* Export of internal Abseil changesGravatar Abseil Team2021-05-27
| | | | | | | | | | | | | | | | | -- cbd86b318ce206d1fe9eb001979b8d2efe57e5fa by Derek Mauro <dmauro@google.com>: Stop inlining `CurrentThreadIdentityIfPresent()` on Apple platforms In some build configurations the Apple linker rejects thread_local variables exposed in headers Fixes #954 Fixes #965 PiperOrigin-RevId: 375930997 GitOrigin-RevId: e34600e09f748b686d20a4f729ae914ebfd9e7bf Change-Id: I9fcd2f02bd6abdea3ed412217e1be18f2c7bf762
* Export of internal Abseil changesGravatar Abseil Team2021-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- d74f30ef0da7139c30a24eb6c1776bc0c257e642 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 375779441 -- 25e33cde30d78dbafcb81ee3ce77c3d70c74db5a by Abseil Team <absl-team@google.com>: Internal change PiperOrigin-RevId: 375520720 -- 46857d17d4dbc6fbd13a27dd82e14ec814dd117a by Samuel Benzaquen <sbenza@google.com>: Add an explicit template parameter barrier to absl::HashOf. PiperOrigin-RevId: 375103300 -- cf2bf52b9a425b0360ed1f46778f0ef1326a3658 by Abseil Team <absl-team@google.com>: Improve string_view API compliance with C++17 std::basic_string_view. This adds missing overloads, default values, and constexpr specifiers. PiperOrigin-RevId: 374885658 -- 41e55166dc5bd3ed7bce567c400781585d55e1ce by Derek Mauro <dmauro@google.com>: Update CI to GCC 11.1, Bazel 4.0.0, CMake 3.20.2, and LLVM git:7bcc0a1e399d461af7ec013ff33bc330a2de6641 PiperOrigin-RevId: 374858288 GitOrigin-RevId: d74f30ef0da7139c30a24eb6c1776bc0c257e642 Change-Id: I657c815c83522b030495ff54ca327e7012ed151e
* Use CMAKE_INSTALL_FULL_{LIBDIR,INCLUDEDIR}. (#963)Gravatar Gabriel Ebner2021-05-25
|
* Export of internal Abseil changesGravatar Abseil Team2021-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 4c6405d1be98fc669b5167970783da00c6a43b86 by Derek Mauro <dmauro@google.com>: Turn off -Warray-bounds for GCC in internal/inlined_vector.h GCC 11 appears to erroneously warn here PiperOrigin-RevId: 374709739 -- be9909b010b3da5967ab0ff44a09be034a1fa82f by Derek Mauro <dmauro@google.com>: Add non-templated operator new and new[] to ThrowingValue. GCC 11 is confused and issues -Wmismatched-new-delete. PiperOrigin-RevId: 374648084 -- a30a87bf1498aff26bcd751daec120d14a934d99 by Derek Mauro <dmauro@google.com>: Simplify ThrowingAllocator::select_on_container_copy_construction to workaround what may be a clang c++20 bug PiperOrigin-RevId: 374630576 GitOrigin-RevId: 4c6405d1be98fc669b5167970783da00c6a43b86 Change-Id: I48f1091c4a0f262961d9059dac4e6b44a82ae91d
* Export of internal Abseil changesGravatar Abseil Team2021-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 30af50146f07d7afdb196abf235f44ec44ea6409 by Derek Mauro <dmauro@google.com>: Update Abseil dependency versions PiperOrigin-RevId: 374415690 -- 6a241e9ea8ee201789bb66aadf9e1ca9cc23c5dc by Derek Mauro <dmauro@google.com>: Fix the install test project, which is doing a mixed-mode build. This manifests in failure with GCC 11, which defaults to C++17 Also explicitly reference python3 in the test script. python2 is being removed by some Linux distros. PiperOrigin-RevId: 374278107 -- 42f85122407e799183880e0b2e2a71f6d35ee003 by Evan Brown <ezb@google.com>: Use `capacity + Group::kWidth` control bytes instead of `capacity + Group::kWidth + 1`. We don't use the extra byte - we only need the first `capacity` ones that are valid, the one sentinel byte and then `Group::kWidth - 1` cloned control bytes. For example, in `EmptyGroup()`, where capacity is 0, we use `Group::kWidth` control bytes. We need to update set_ctrl() to only mirror `Group::kWidth - 1` bytes instead of `Group::kWidth` bytes. Note: this doesn't actually save memory unless `alignof(value_type)` is one. Also add/update related comments. PiperOrigin-RevId: 374198589 -- 5dcd09b2221bf23add583541769b476dac54e112 by Evan Brown <ezb@google.com>: Improve b-tree value_comp() support. - Don't expose internal adapted comparator functionality. - Support value_comp() for maps using function pointer comparators. - For maps, make value_compare's constructor and the member comparator be protected - [reference](https://en.cppreference.com/w/cpp/container/map/value_compare). PiperOrigin-RevId: 373832649 -- d75819786ff5a06e1ed0c5c1e80b3b95ac49c83b by Evan Brown <ezb@google.com>: Don't export adapted comparator functionality in key_comp(). PiperOrigin-RevId: 373651039 GitOrigin-RevId: 30af50146f07d7afdb196abf235f44ec44ea6409 Change-Id: I260480b0923cefeba81c543e2b7c34cacaa7d7c7
* Export of internal Abseil changesGravatar Abseil Team2021-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 912c205cf80c4ed24a08000c04263403857b7f75 by Abseil Team <absl-team@google.com>: Internal change PiperOrigin-RevId: 373620391 -- d454f10549d27d7b025d1ce0ef90a0cdec42c361 by Martijn Vels <mvels@google.com>: Add SetCordRepForTesting() helper to CordzInfo PiperOrigin-RevId: 373602832 -- 7a2d7bdd2e60fb51333e81cd71ebd0a4edb60704 by Evan Brown <ezb@google.com>: For StrAppend, make sure to follow exponential growth like std::string::append. PiperOrigin-RevId: 373589332 -- 24397f19bce45133a42feaa7c883009ef9325095 by Greg Falcon <gfalcon@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 373569246 GitOrigin-RevId: 912c205cf80c4ed24a08000c04263403857b7f75 Change-Id: I5444f7ca2c0980685ca5c51596c259b845d69673
* Export of internal Abseil changesGravatar Abseil Team2021-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 9fc37c11b9e46287acef00ee06ed9adcba54dd13 by Greg Falcon <gfalcon@google.com>: Rename absl::hash_internal::HashState to absl::hash_internal::MixingHashState. Before this change, we had two classes named HashState: absl::HashState, the public API used for type erasure, and absl::hash_internal::HashState, the internal concrete implementation ordinarily used. The internal class used to be named `CityHashState`, but we renamed it to `HashState` it when we changed underlying hash implementation to wyhash. This inadvertent naming conflict made the code much harder to read, and this change intends to undo that. PiperOrigin-RevId: 373481959 -- 4aec55ffddebd085c239352a2e20721091f719a1 by Greg Falcon <gfalcon@google.com>: Introduce absl::HashOf(), a convenience wrapper around absl::Hash that calculates hashes from the values of its arguments. PiperOrigin-RevId: 373461406 -- 86b5fd8db50bbc8bd0aa9258523527381fe0445d by Abseil Team <absl-team@google.com>: Improve speed of BlockingCounter by making its most common path lock free. With the new implementation, the fast path of BlockingCounter::DecrementCount() is only a fetch_sub operation. This is most times much more efficient than the previous implementation (full mutex lock/unlock). As a matter of fact, in most actual usecases in practice, the waiter thread is already waiting on the Wait() call when DecrementCount() is called, which makes Mutex::Unlock() take the slow path as there's a waiter thread that it might need to wake up. PiperOrigin-RevId: 373394164 -- 65c876be5eac0cd32583ff8535ede4109d39cf3f by Martijn Vels <mvels@google.com>: Move the 'sample copied cord' logic into MaybeTrackCord(), This changes move the logic for selecting if a cord should remain being sampled from Cord to CordzInfo::MaybeTrackCord, and updates the documentation for the latter method. PiperOrigin-RevId: 373363168 -- e84410bd0aada293a81dfb82656c952e209e21fb by Martijn Vels <mvels@google.com>: Add check for the first call to cordz_should_profile() for each thread. This prevents the first cord of a newly created thread to be always sampled, which is a 'bad' kind of determinism for sampling. PiperOrigin-RevId: 373229768 -- bf09c589dc099ac8f4af780bf7e609c53c27574c by Samuel Benzaquen <sbenza@google.com>: Refactor the Flags structure into an enum. This gives us more control over the representation and allows for easier merging during parsing. PiperOrigin-RevId: 373163038 -- b947b0c51083b7b6508284b5d31819596c91729e by Derek Mauro <dmauro@google.com>: Fixes warnings about shadowed variables Fixes #956 PiperOrigin-RevId: 373158133 GitOrigin-RevId: 9fc37c11b9e46287acef00ee06ed9adcba54dd13 Change-Id: I91f35699f9bf439d1a870c6493946a310afe088c
* Export of internal Abseil changesGravatar Abseil Team2021-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 5f3c139695d5c497ca030e95a607537a7be7caa7 by Benjamin Barenblat <bbaren@google.com>: Don’t examine irrelevant destination buckets in DiscreteDistributionTest Abseil generates discrete distributions using Walker’s aliasing algorithm. This creates uniformly distributed buckets, each with a probability of sending traffic to a different bucket. Abseil represents a bucket as a pair (probability of retaining traffic × alternate bucket if traffic is passed) and a distribution as a vector of such pairs. For example, {(0.3, 1), (1.0, 1)} represents a distribution with two buckets, the zeroth of which passes 70% of its traffic to bucket 1 and the first of which holds on to all its traffic. This representation is not unique: When a bucket retains traffic with probability 1, the alternate bucket is irrelevant. Continuing the example above, {(0.3, 1), (1.0, 0)} _also_ represents a two-bucket distribution where the zeroth bucket passes 70% of its traffic to the first and the first hangs on to all traffic. Exactly what representation Abseil generates for a given input is related to how much precision is used in intermediate floating-point operations, which is an architectural implementation detail. Remove sensitivity to that detail by not examining the alternate bucket when the retention probability is 1.0. PiperOrigin-RevId: 372993410 -- 062ac80699f748831c09a061538abffec2cdea5c by Martijn Vels <mvels@google.com>: Avoid alredy sampled cord remaining sampled if not picked or source is sampled PiperOrigin-RevId: 372985990 -- a9f3537e1110b7bb6450fd72a03f0c5dc6b8c89b by Evan Brown <ezb@google.com>: Add tests for function pointer comparators, comparators that have SFINAE-visible comparison operators that are unimplemented, and for implicit construction from unadapted comparators. PiperOrigin-RevId: 372927616 GitOrigin-RevId: 5f3c139695d5c497ca030e95a607537a7be7caa7 Change-Id: I996a8452e7bd88f9dd2e59633b01bbc09f42620d
* Export of internal Abseil changesGravatar Abseil Team2021-05-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 51e9291d9bc385082b4061fe760b236ba59c79c3 by Abseil Team <absl-team@google.com>: Cast to uint64_t using braces instead of parentheses. PiperOrigin-RevId: 372475909 -- 939fc409855da2639dcaf2d1d4971ca0e0568d03 by Martijn Vels <mvels@google.com>: Expand # flat nodes into size detailed counters. PiperOrigin-RevId: 372474608 -- 54b158c99b32f8a14821ce74fed0f9f836525ce7 by Martijn Vels <mvels@google.com>: Make copies of sampled cords sampled as well This applies to the following methods: - Cord(const Cord&) - operator=(const Cord&) - Subcord(...) PiperOrigin-RevId: 372468160 -- 876c2581ce008871464e8b471efbb967d150f83b by Andy Getzendanner <durandal@google.com>: Document the type of an ABSL_FLAGS.OnUpdate() callback. PiperOrigin-RevId: 372406390 GitOrigin-RevId: 51e9291d9bc385082b4061fe760b236ba59c79c3 Change-Id: Ifb75122cae56b66c28128aee90a63bbb28d93817
* Export of internal Abseil changesGravatar Abseil Team2021-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | -- daf5a2b9ab3507ad5fb9aebe9165933f33098b83 by Abseil Team <absl-team@google.com>: Absl flat containers reserve enough space even in the presence of tombstones. PiperOrigin-RevId: 372339945 -- 9a61504867ba0eccc5046d7333090fbe3439cdd9 by Abseil Team <absl-team@google.com>: Add benchmark for BlockingCounter PiperOrigin-RevId: 372246068 -- 91ee87e6de09fc62970667ee52654c9dcf7c478d by Evan Brown <ezb@google.com>: In absl::StrSplit, support btree_multimap, and other non-std::multimap-multimaps by supporting any map type that returns iterator from insert(). Also: - Use emplace() instead of insert() when available, not just for std::(multi)map - we can potentially change some string copies to moves this way. - We no longer need the Insert class so remove it. PiperOrigin-RevId: 372209653 GitOrigin-RevId: daf5a2b9ab3507ad5fb9aebe9165933f33098b83 Change-Id: I83098fde4a722cd4b682f024d3bfa56c613f960c
* Export of internal Abseil changesGravatar Abseil Team2021-05-05
| | | | | | | | | | | | | | | | | | -- d8a1e7f8059a0bc4cd72b4e4ca2947322c36f7ee by Martijn Vels <mvels@google.com>: Add cordz allowlist and cleanup COPTS PiperOrigin-RevId: 372042499 -- 2abd20ac17127b8823787bfcdd3e7e80709d3034 by Evan Brown <ezb@google.com>: Remove unnecessary string conversion now that FormatTime accepts string_view. PiperOrigin-RevId: 371989142 GitOrigin-RevId: d8a1e7f8059a0bc4cd72b4e4ca2947322c36f7ee Change-Id: I637e9fa434de9b2c38fd0f96d66eefc6e8eec8e8
* Export of internal Abseil changesGravatar Abseil Team2021-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | -- 5d6734366ec54997df5234ac3b7e21015d7d5fde by Martijn Vels <mvels@google.com>: Increase slop for unit test to reduce flakiness of test PiperOrigin-RevId: 371935786 -- 6e97ff23e7f732ebf969bbc69102e5e677aae8cd by Martijn Vels <mvels@google.com>: Add node and memory usage stats analysis to GetCordzStatistics. PiperOrigin-RevId: 371893353 -- 17f7443e6f988f25efa25c2291c1cde191af2bf2 by Martijn Vels <mvels@google.com>: Add check on n == 0 in CordReader::ReadCord, which breaks invariants in the ring buffer code. PiperOrigin-RevId: 371738207 GitOrigin-RevId: 5d6734366ec54997df5234ac3b7e21015d7d5fde Change-Id: I0fc883f4f49f2380ab9afddbdfe6eb5ccc15dfc3
* Export of internal Abseil changesGravatar Abseil Team2021-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | -- cf88f9cf40eab54c06bca7f20795352ec23bb583 by Derek Mauro <dmauro@google.com>: Fixes build with latest glibc Fixes #952 PiperOrigin-RevId: 371693908 -- 99bcd0f4a747ce7a401e23c745adf34d0ec5131b by Samuel Benzaquen <sbenza@google.com>: Add support for std::string_view in StrFormat even when absl::string_view != std::string_view. PiperOrigin-RevId: 371693633 -- e35463572149a6c2d4a0d439b9300ce03fd6b96d by Abseil Team <absl-team@google.com>: Cmake builds should only install pkg-config when explicitly requested. PiperOrigin-RevId: 371403419 GitOrigin-RevId: cf88f9cf40eab54c06bca7f20795352ec23bb583 Change-Id: I4360a18c638a4d901ff44ab1e0a9d8f321c302ea
* Export of internal Abseil changesGravatar Abseil Team2021-04-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 60b8e77be4bab1bbd3b4c3b70054879229634511 by Derek Mauro <dmauro@google.com>: Use _MSVC_LANG for some C++ dialect checks since MSVC doesn't set __cplusplus accurately by default. https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ See GitHub #722. PiperOrigin-RevId: 371362181 -- 5d736accdff04db0e722f377c0d79f2d3ed53263 by Martijn Vels <mvels@google.com>: Fix the estimated memory size for CordRepExternal PiperOrigin-RevId: 371350380 -- eaaa1d8a167aeca67a2aa3a098a2b61a9d72172f by Martijn Vels <mvels@google.com>: Remove flakes by not enforcing re-allocated pointers do never match original Tests that do multiple updates could end up with the original allocated pointer on a 2nd resize, so the 'EqIfPrivate' should not assume that if we do 'not' have the capacity that all following relocations will never match the original. We only care about 'pointer unchanged if private and there is capacity', trying to establish 'pointer changed at some point due to re-allocation; is pointless. PiperOrigin-RevId: 371338965 -- d1837bee6bade1902b095c1cbf64231668bb84c5 by Martijn Vels <mvels@google.com>: Undo inline of small data copy in cord This leads to a performance regression as the code is not inlined (absent hard FDO inputs), and there are no suitable tail call options. PiperOrigin-RevId: 371332332 -- 06dc64b833069efc7d18b11df607c8c22be690da by Martijn Vels <mvels@google.com>: Add final instrumentation for Cordz and remove 'old' cordz logic. This change instruments the last cord function for cordz. It removes the 'old' functions: set_tree, replace_tree, UpdateCordzStatistics and RecordMetrics. PiperOrigin-RevId: 371219909 -- a5e0be538579c603052feec03e6d9910c43ea787 by Martijn Vels <mvels@google.com>: Extend the life of CordRep* if inside a snapshot If a snapshot (potentially) includes the current CordzInfo, we need to extent the lifetime of the CordRep*, as the snapshot 'point in time' observation of the cord should ideally be preserved. PiperOrigin-RevId: 371146151 -- 74d77a89774cd6c8ecdeebee0193b294a39383d6 by Martijn Vels <mvels@google.com>: Instrument std::string consuming methods: ctor, operator=, Append and Prepend This change moves the 'steal into CordRep' logic into a separate function so we can use it directly in the ctor, operator assign and append and prepend, allowing Cordz instrumentation with the proper method attributes. The assign operator is implemented in AssignLargeString leaving the dispatch inlined in cord.h (which as a side effects also allows clean tail calls in the AssignLargeString method) PiperOrigin-RevId: 371094756 -- b39effc45266b7ce2e7f96caa3b16cb6e3acc2dd by Martijn Vels <mvels@google.com>: Add Cordz instrumentation to CordReader PiperOrigin-RevId: 370990181 GitOrigin-RevId: 60b8e77be4bab1bbd3b4c3b70054879229634511 Change-Id: I96af62e6f1a643e8b1228ae01e6c84e33706bb05
* Export of internal Abseil changesGravatar Abseil Team2021-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- a78c34c705b15598ea00171d4ff8755e38fad863 by Derek Mauro <dmauro@google.com>: Improve compiler support for ABSL_FALLTHROUGH_INTENDED PiperOrigin-RevId: 370952333 -- aed0c26f1a2aac98e217ad1b44ce4a858780a223 by Martijn Vels <mvels@google.com>: Add Cordz instrumentation for Flatten PiperOrigin-RevId: 370815149 -- ff4a58d0109d39dc32ef7a5e5e669ca4e630c6d9 by Martijn Vels <mvels@google.com>: Add Cordz instrumentation to RemovePrefix and RemoveSuffix PiperOrigin-RevId: 370751602 -- 40220a058b30ddd89c6e547591488d15342137dd by Martijn Vels <mvels@google.com>: Add Cordz instrumentation to operator=(string_view) PiperOrigin-RevId: 370737600 -- a2e49604f18b92e50b179b5477dfddb8f57538ca by Martijn Vels <mvels@google.com>: Add cordz instrumentation for Subcord PiperOrigin-RevId: 370724107 -- bcc3902e04fb4f14270aef00e18908e6a88474cd by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 370707219 GitOrigin-RevId: a78c34c705b15598ea00171d4ff8755e38fad863 Change-Id: I0270e536cbdeaf1f195199da822b314521de3b96
* Uses alignas for portability in dynamic_annotations.h (#947)Gravatar Jeremy Ong2021-04-27
| | | Fixes an MSVC compiler error when address sanitizers are enabled
* Export of internal Abseil changesGravatar Abseil Team2021-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- f6fbb03bff276e72123e8590519079e87732ae62 by Abseil Team <absl-team@google.com>: Replace static absl::Mutex with SpinLock in absl::Cords to avoid static initializers by absl::Mutex destructors PiperOrigin-RevId: 370694199 -- 654b7d9edfdc24f226990b2b46cbf91451a1d92a by Martijn Vels <mvels@google.com>: Implement global data for CordzInfo in an ODR hardened way This change puts the global data into a global list structure, and stores a reference to the global list in the handle itself. This hardens the implementation against ODR violations where info pointers are crossing dynamic library boundaries which are privately loaded. PiperOrigin-RevId: 370673045 -- 712dba768e66ee2ba85d6010829c617cd2af6ba7 by Martijn Vels <mvels@google.com>: Intrument Cord::operator= for Cordz PiperOrigin-RevId: 370659149 -- c0b347a2289e151b72680269332e264b8fa989c0 by Matt Kulukundis <kfm@google.com>: Fix test guards for ABSL_ATTRIBUTE_RETURNS_NONNULL PiperOrigin-RevId: 370594807 -- c2bedaa3472ef223f907de2604f9b9b58852ec5f by Martijn Vels <mvels@google.com>: Add new Cordz instrumentation on GetAppendRegion. PiperOrigin-RevId: 370587761 -- 84fbfcc852697d509f6094482b86e84743a6b331 by Martijn Vels <mvels@google.com>: Add instrumentation on Cord::Apppend(string_view) PiperOrigin-RevId: 370576590 -- 9e077390b8ca2239e1cb7bfbe1d5a04f2fc11d30 by Abseil Team <absl-team@google.com>: Google-internal changes only. PiperOrigin-RevId: 370558424 -- fb53c149eb2364ea34e3a67235f873866618b8ac by Matt Kulukundis <kfm@google.com>: Update config.h macros with a few useful helpers to simplify version checking PiperOrigin-RevId: 370557684 -- abf8142e99b9ff7e15f6528a357f1005461950b0 by Martijn Vels <mvels@google.com>: clang-format cord PiperOrigin-RevId: 370549371 -- e555985eabe63fcf0e980e9c433dd84caffec191 by Martijn Vels <mvels@google.com>: Add MaybeUntrackCord() function This function is near identical to the old UntrackCord() but allows info to be null, moving the cord.is_profiled() branch into CordzInfo. PiperOrigin-RevId: 370528447 -- 3883538efe4601f7864bda70a50d868bb383c63b by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 370503186 -- a9514b65542fde1bc73584e6f3c1c4b3a05f215f by Derek Mauro <dmauro@google.com>: Add -Winvalid-constexpr to warning options for LLVM PiperOrigin-RevId: 370455171 -- d8a3966de2cf15a2dc28e17e49a3d27d205eca92 by Martijn Vels <mvels@google.com>: Add naive UniqueGenerator<T, kMaxValues, ...> to avoid flakes from dup random values. PiperOrigin-RevId: 370179772 -- 46d0caa1a12b68a5998d4f919e20f0f83b9286f8 by Martijn Vels <mvels@google.com>: Add new Cordz instrumentation on PrependTree. PiperOrigin-RevId: 370138969 GitOrigin-RevId: f6fbb03bff276e72123e8590519079e87732ae62 Change-Id: Ifa4c00a5c7b01198ee367a3253bea6b66612135e
* Export of internal Abseil changesGravatar Abseil Team2021-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- f825cf3feb6db06522b2b4ee785de7dfa325780d by Martijn Vels <mvels@google.com>: Move Cordz test helpers to cordz_test_helpers library PiperOrigin-RevId: 370059941 -- 5080249da6a4f5cc2b546aed48503fd028670379 by Martijn Vels <mvels@google.com>: Add new Cordz instrumentation on AppendTree. PiperOrigin-RevId: 369968167 -- 21092b889fad34ec605894e311b436d5f417456f by Benjamin Barenblat <bbaren@google.com>: Round floats using round(x), not static_cast<int>(x + 0.5) Adding 0.5 to an IEEE float may cause one bit of precision loss, which is enough to change the result in certain cases. For example, static_cast<int>(std::round(0.49999999999999994)) == 0 static_cast<int>(0.49999999999999994 + 0.5) == 1 PiperOrigin-RevId: 369926519 GitOrigin-RevId: f825cf3feb6db06522b2b4ee785de7dfa325780d Change-Id: Ib78ce1faec79f06578933db5dc6fc05de043ead1
* Export of internal Abseil changesGravatar Abseil Team2021-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 9e0df3dd23da17cd0ff75c93c1493a858032639c by Martijn Vels <mvels@google.com>: Prep work for changing Cordz instrumentation Create CordzInfo::TrackCord() and CordzInfo::MaybeTrackCord() methods on InlineData This follows a suggestion from kfm@ to move where possible Cordz logic out of Cord and Cord::InlineRep, which we can now that InlineData provides us the abstraction of Cords internal data. PiperOrigin-RevId: 369844310 -- 45f39709033bd3bc09fa1a7880a5b3c9eaa617c7 by Abseil Team <absl-team@google.com>: Fix dependence on C++20 constexpr default construction of std::atomic. PiperOrigin-RevId: 369745251 -- 195ae230963c95068406ab0e73b4e711b5f3cd62 by Martijn Vels <mvels@google.com>: Reduce the cost of 'SetCordRep()` This change inlines SetCordRep(), which is currently two stores and a branch, going forward a naked store. AssertHeld is only enforced for debug builds. The intention here is not to reduce the 'actual' (or 'self') cost of SetCordRep() as it should only be called for sampled cords, but to reduce the cost of a branch and out of line call at the call site. The compiler can now 'perfectly inline' the single branch / store. PiperOrigin-RevId: 369696265 -- d722199ed69d413994740624159ac7bd001a9219 by Martijn Vels <mvels@google.com>: Add kDefaultInit initialization This avoids double store on init PiperOrigin-RevId: 369655217 -- 3499aed79e6cc12ce36277063ec37991bba0cccd by Martijn Vels <mvels@google.com>: Introduce CordzUpdateScope PiperOrigin-RevId: 369491326 -- 325c1bc99c7d1aeca7bd1273e51a0900b6faf731 by Abseil Team <absl-team@google.com>: make unary and logical operators constexpr PiperOrigin-RevId: 369476773 -- ad3bed3dea5e5d7d281ff36ee786f802630c3728 by Martijn Vels <mvels@google.com>: Add LOCKABLE attribute to CordzInfo PiperOrigin-RevId: 369476772 GitOrigin-RevId: 9e0df3dd23da17cd0ff75c93c1493a858032639c Change-Id: I00e2859328fe8da46d2e04d3f07dfe70ec6cb1f5
* Export of internal Abseil changesGravatar Abseil Team2021-04-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- ac1df60490c9583e475e22de7adfc40023196fbf by Martijn Vels <mvels@google.com>: Change Cord constructor(string_view) to explicit make_tree and Cordz tracking This CL changes the ctor to use an easier to maintain model where Cord code explicitly invokes Cordz update or new / tree logic, which avoids the ambiguity of the 'branched' InlineRep::set_tree code. This removes the need to equip InlineRep with 'MethodIdentifier' or other necessary call info, and also is a cleaner model: InlineRep is carrying too much code now that should plainly sit in Cord, especially with all internal abstractions having moved to InlineData. See child CL(s) for desired state PiperOrigin-RevId: 369433619 -- b665af7f586e6c679a8b27d4f78d5a1d2b596058 by Abseil Team <absl-team@google.com>: Rename the 'Compare' template type to 'LessThan', as the passed-in function is expected to act like operator<. It is worth avoiding confusion with std::compare, which returns an int (-1/0/1), as due to implicit casting this can lead to hard-to-spot bugs. PiperOrigin-RevId: 369391118 -- c3c775269cad0f4982ec63f3616dd78bb9e52dca by Martijn Vels <mvels@google.com>: Integrate CordzUpdateTracker into CordzInfo PiperOrigin-RevId: 369348824 -- 771d81ed357496c117179e1daec76eba5155932d by Martijn Vels <mvels@google.com>: Replace mutex() with Lock() / Unlock() function Mini design future tracking of CordzInfo sampled cords: CordzInfo holds a CordRep* reference without a reference count. Cord is responsible for synchronizing updates for sampled cords such that the CordRep* contained in CordzInfo is at all times valid. This is done by scoping Lock() and Unlock() calls around the code modifying the code of a sampled cord. For example (using the future CL CordzUpdateScope()): CordzInfo* cordz_info = get_cordz_info(); CordzUpdateScope scope(cordz_info, CordzUpdateTracker::kRemovePrefix); CordRep* rep = RemovePrefixImpl(root); set_tree(rep); if (cordz_info) { cordz_info->SetCordRep(rep); } On CordzInfo::Unlock(), if the internal rep is null, the cord is no longer sampled, and CordzInfo will be deleted. Thus any update resulting in the Cord being inlined will automatically no longer be sampled. PiperOrigin-RevId: 369338802 -- 5563c12df04a1e965a03b50bdd032739c55c0706 by Martijn Vels <mvels@google.com>: Add UpdateTracker to CordzStatistics PiperOrigin-RevId: 369318178 -- 6b4d8463722a3e55a3e8f6cb3741a41055e7f83e by Martijn Vels <mvels@google.com>: Add kClear, kConstructor* and kUnknown values and fix typo PiperOrigin-RevId: 369297163 -- 041adcbc929789d6d53371a8236840fc350e1eeb by Derek Mauro <dmauro@google.com>: Switch from malloc to operator new in pool_urbg.cc so it can only fail by throwing/aborting PiperOrigin-RevId: 369274087 -- 5d97a5f43e3f2d02d0a5bbe586d93b5751812981 by Benjamin Barenblat <bbaren@google.com>: Correct Thumb function bound computation in the symbolizer On 32-bit ARM, all functions are aligned to multiples of two bytes, and the lowest-order bit in a function’s address is ignored by the CPU when computing branch targets. That bit is still present in instructions and ELF symbol tables, though; it’s repurposed to indicate whether the function contains ARM or Thumb code. If the symbolizer doesn’t ignore that bit, it will believe Thumb functions have boundaries that are off by one byte, so instruct the symbolizer to null out the lowest-order bit after retrieving it from the symbol table. PiperOrigin-RevId: 369254082 -- 462bb307c6cc332c1e2c3adb5f0cad51804bf937 by Derek Mauro <dmauro@google.com>: Add a check for malloc failure in pool_urbg.cc GitHub #940 PiperOrigin-RevId: 369238100 GitOrigin-RevId: ac1df60490c9583e475e22de7adfc40023196fbf Change-Id: Ic6ec91c62cd3a0031f6a75a43a83da959ece2d25
* Export of internal Abseil changesGravatar Abseil Team2021-04-16
| | | | | | | | | | | | | -- c7ce91501834b225bc9cf2d3fa2a319dd0b7f864 by Martijn Vels <mvels@google.com>: Implement global data for CordzHandle in an ODR hardened way This change puts the global data into a global delete queue structure, and stores a reference to the global data in the handle itself. This hardens the implementation against ODR violations where handles are crossing dynamic library boundaries which are privately loaded. PiperOrigin-RevId: 368885636 GitOrigin-RevId: c7ce91501834b225bc9cf2d3fa2a319dd0b7f864 Change-Id: I9775151a760b30989dec9517e4bcd2183e8c1651
* Export of internal Abseil changesGravatar Abseil Team2021-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 341670bce317dd6af8d3c066970230591a47e80c by Martijn Vels <mvels@google.com>: Change GetStack() and GetParentStack() to return absl::Span PiperOrigin-RevId: 368765721 -- 6aaab9536d6957303c7aba100c3afaa6fb0ea2c8 by Martijn Vels <mvels@google.com>: Remove locking from parent stack. This change removes the need to lock all access to `parent_stack' by making the 'copy constructor' logic specify the 'copied from' CordzInfo (where available) to the TrackCord function, after which parent_stack is immutable. PiperOrigin-RevId: 368760630 -- b19e2059cada35a8ede994833018edac94de6ddc by Martijn Vels <mvels@google.com>: Add cordz instrumentation to Cord PiperOrigin-RevId: 368746225 -- 67b8bbf980f0f4e1db79aa32968e9a715a09b51a by Martijn Vels <mvels@google.com>: Create ABSL_INTERNAL_CORDZ_ENABLED define controlling when Cordz code is enabled There are specific builds and condtions under which we don't support cordz sampling, which is per this change represented by ABSL_INTERNAL_CORDZ_ENABLED being defined. PiperOrigin-RevId: 368731603 -- 8cbfe0e3169637a620f4b66ad2bc2ce340879cb0 by Martijn Vels <mvels@google.com>: Add a `rep` property to CordzInfo to be managed by Cord logic. This change adds a `rep` property to CordzInfo, which is intended to be used by collection logic. Mini design: Cord invokes TrackCord() providing the active 'root' cordrep of the newly sampled Cord, returning a CordzInfo with a weak (uncounted) reference to this root. Cord invokes `SetCordRep()` each time the root cordrep of the sampled Cord is updated while holding `mutex()`. Cord must also obtain `mutex()` _before_ removing a reference on the old root. i.e.: Cord must guarantee that the (weak) reference held in CordzInfo is at all times valid. CordzInfo collection code can then safely obtain a (reference counted) rep pointer by adding a reference to `rep_` while holding `mutex()`. This requires only a very brief critical section inside CordzInfo logic, minimizing contention with concurrent Cord updates. Cord code should typically obtain and hold `mutex()` for the entirety of each mutating Cord operation on a sampled cord. As Cord is thread compatible, it never competes on the lock with any other thread. The only possible concurrent access is from Cordz collection code, which should be a relatively rare event. PiperOrigin-RevId: 368673758 -- 1255120dce2bdd6b4205a34a0e555e0b74b6152f by Martijn Vels <mvels@google.com>: Remove 'depth' from active recorded metrics. Going forward we do not 'live' record depth (and size), but will observe these at collection time only. PiperOrigin-RevId: 368636572 -- 83e5146e35f221736b49e9f0a8805f8c159a51db by Martijn Vels <mvels@google.com>: Make cordz targets visible in OSS PiperOrigin-RevId: 368615010 -- dcb16a4f1239151f0a8c70a8cfeb29dabbd113b8 by Martijn Vels <mvels@google.com>: Internal cleanup PiperOrigin-RevId: 368514666 GitOrigin-RevId: 341670bce317dd6af8d3c066970230591a47e80c Change-Id: I94cecfbbd441eb386f99fc5186c468a7a5538862
* Export of internal Abseil changesGravatar Abseil Team2021-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 5ff0c4b38386ae80b25e9f8d0e1bac07fd7ce92c by Martijn Vels <mvels@google.com>: Add CordzUpdateTracker class PiperOrigin-RevId: 368469046 -- 4de916b1ba4b5480b4dbe93d28c5eaa110449c66 by Derek Mauro <dmauro@google.com>: Adds `ABSL_ATTRIBUTE_LIFETIME_BOUND` to `absl::Span`s initializer_list constructor. Compilers that support this attribute will emit a warning if the parameter does not have sufficient lifetime. For more information, see https://github.com/abseil/abseil-cpp/blob/b97a1ecda869ca8754d467a56c50275cebfeb328/absl/types/span.h#L209-L248 PiperOrigin-RevId: 368429085 -- bb6669016412bf5afffc02d0818a66dfe1c524cf by Martijn Vels <mvels@google.com>: Reorganize internal cord code in CMakeLists.txt into cord_internal library PiperOrigin-RevId: 368423765 -- d1d7fce066172d5fcfa0310c4e27631d895d7e50 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 368346725 GitOrigin-RevId: 5ff0c4b38386ae80b25e9f8d0e1bac07fd7ce92c Change-Id: Ic4627eab4f0274e400a6d12cde3341fb538de075
* Call FailureSignalHandlerOptions.writenfn with nullptr at the end (#938)Gravatar Yasushi Saito2021-04-13
| | | | | | | | | | | | | | | * Call FailureSignalHandlerOptions.writenfn with nullptr at the end This behavior has already been alluded to in the document, but it hasn't been implemented. This PR calls changes the failure signal handler to call writerfn(nullptr) at the end of the message block. It also clarifies the documentation. https://github.com/abseil/abseil-cpp/issues/933 * Update failure_signal_handler.h Co-authored-by: Derek Mauro <761129+derekmauro@users.noreply.github.com>
* Export of internal Abseil changesGravatar Abseil Team2021-04-13
| | | | | | | | | | | | | | | | | | -- f09549625d7417fca379ff68334379d281480608 by Martijn Vels <mvels@google.com>: Fix GetNumCPUs() for WIN32 platforms PiperOrigin-RevId: 368245360 -- e903c6690d0568f80356e03b07a895b031553977 by Abseil Team <absl-team@google.com>: Optimize `Cord::InlineRep::InlineRep(Cord::InlineRep&& src)`. PiperOrigin-RevId: 368198990 GitOrigin-RevId: f09549625d7417fca379ff68334379d281480608 Change-Id: I2d750c8c87f2804335a60ba8db949dedfaa462e2
* Export of internal Abseil changesGravatar Abseil Team2021-04-13
| | | | | | | | | | | | | | | | | | -- 9bd9d083a21d1436816dc842a80d4339aa49a24b by Abseil Team <absl-team@google.com>: Inline Status::NewRep, pass `message` via string_view in StatusRep ctor PiperOrigin-RevId: 367641069 -- 9cebe53e8f1717f82394501fd9f4bc70d2051b33 by Benjamin Barenblat <bbaren@google.com>: Fix typo in CordRepRing error message PiperOrigin-RevId: 367481280 GitOrigin-RevId: 9bd9d083a21d1436816dc842a80d4339aa49a24b Change-Id: Ie2c51bf6f46abed5c2317ceee30bd2bb59502f8e
* Export of internal Abseil changesGravatar Abseil Team2021-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 8e3ed8c8f770f9371f037e4956334b6e38525e91 by Abseil Team <absl-team@google.com>: Remove legacy, non-standard sanitizer macros. PiperOrigin-RevId: 367079577 -- c06aa9b9c20ba2e87dfc6933bbf8a30e0502d70a by Martijn Vels <mvels@google.com>: Remove kFakeCordzInfo and last caller to set_profiled() These have all been superseded by clear_cordz_info() and set_cordz_info() PiperOrigin-RevId: 367020835 -- e0bd3e4e0b46db495663261a1664815eb94999f8 by Abseil Team <absl-team@google.com>: AbseilConfigureCopts.cmake: fix AppleClang detection restore use of MATCHES in comparison with "Clang"; this was lost in: commit 22771d471930ce88e1e75d0ca9dd8c65a7b0f895 ... 24e1f5f72756046f5265abf618e951c341f09b8d by Derek Mauro <dmauro@google.com>: Fixes failing CMake string comparisons https://cmake.org/cmake/help/latest/policy/CMP0054.html fixes: CMake Warning at absl/copts/AbseilConfigureCopts.cmake:61 (message): Unknown compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++. Building with no default flags Fixes #930 PiperOrigin-RevId: 366879337 GitOrigin-RevId: 8e3ed8c8f770f9371f037e4956334b6e38525e91 Change-Id: I7b027b7e82491676b59dc9d23cfe063ea6004d3b
* Export of internal Abseil changesGravatar Abseil Team2021-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 51798d2ac9c95ee8955955c5d8d78b4c9592ecf7 by Derek Mauro <dmauro@google.com>: Correctly install pkgconfig files under CMAKE_INSTALL_LIBDIR Fixes #931 PiperOrigin-RevId: 366816645 -- fbaad678b54dae70e4cd9f4442b4fef9efb71b30 by Abseil Team <absl-team@google.com>: Add a kDefaultStatusToStringMode representing the default StatusToStringMode. PiperOrigin-RevId: 366478305 -- 25b4be6a591e8b25338a00be1273cd6cae6b0165 by Evan Brown <ezb@google.com>: Fix a typo in a comment. PiperOrigin-RevId: 366464483 -- 6add48ed8f633c219f02c6ef8af876f8dbaa9955 by Abseil Team <absl-team@google.com>: Update comment to mention absl::container_literal::Layout which is what is used instead of gtl::Layout. PiperOrigin-RevId: 366452345 GitOrigin-RevId: 51798d2ac9c95ee8955955c5d8d78b4c9592ecf7 Change-Id: I8e68bc55d81445b2f6f707943fed9075cd402844
* Export of internal Abseil changesGravatar Abseil Team2021-04-01
| | | | | | | | | | | -- c207f164477b5c7f0cb1c5c8bfdc1430b457da17 by Martijn Vels <mvels@google.com>: Add a 'node()' property to CordRepRingReader. PiperOrigin-RevId: 366254778 GitOrigin-RevId: c207f164477b5c7f0cb1c5c8bfdc1430b457da17 Change-Id: I90478d151c2ab5d2ceed6de9fb4946a6a4b48f32
* Export of internal Abseil changesGravatar Abseil Team2021-04-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 6cfac39ea1266f01f195de5eb4c9a6fc9ea9b20a by Matt Kulukundis <kfm@google.com>: Fix a typo PiperOrigin-RevId: 366174890 -- 6ee8c58647aef171d394e59fa06f9bf8cd0306ec by Derek Mauro <dmauro@google.com>: Adds `ABSL_ATTRIBUTE_LIFETIME_BOUND` and applies it to the `const std::string&` constructor of `absl::string_view`. Compilers that support this attribute will emit a warning if the parameter does not have sufficient lifetime. PiperOrigin-RevId: 366027738 -- b944427d96e4b436b8fa0fe396c2a1118dbbbd13 by Abseil Team <absl-team@google.com>: Calls to `ResetToEmpty()` from `ClearSlow` use ~3% of the time in assignment. However, `ClearSlow()` is only used in contexts where `data_` is immediately reassigned. Rename `ClearSlow()` into `UnrefTree()` and remove `data_` resetting. PiperOrigin-RevId: 365977213 -- 7428b3147a5672c8bb55649efa3a1cfe19b52a8b by Abseil Team <absl-team@google.com>: Fix CordRepRing diabolical growth The 'Mutable' function in CordRepRing was over-eager in doubling capacity, which lead to 'ludicrous' growth in the diabolical test case as added to cord_test. This CL fixes the doubling for growing shared reps, and tempers CordRepRing growth for non shared capacity to 1.5 instead of 2, which is more inline with a conservative growth we also have in tree cord. After this change, CordRepRing no longer swamps the heap into the shadow realm, and is in effect reducing the memory used compared to the tree implementation. With a diabolical 5000 bytes growth pattern: Tree cord: 1523520 bytes Ring cord: 274232 bytes PiperOrigin-RevId: 365915857 -- f24d4aee48b03c5a7980664df903f947cbb198e8 by Andy Getzendanner <durandal@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 365873932 GitOrigin-RevId: 6cfac39ea1266f01f195de5eb4c9a6fc9ea9b20a Change-Id: I9737aa215ac732c9785a1d0032c77aba62330f12
* Export of internal Abseil changesGravatar Abseil Team2021-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 45c3adace0020bb705e04d254f7b3f914d2ba2e6 by Abseil Team <absl-team@google.com>: Cleanup CordRepRing unit tests PiperOrigin-RevId: 365848947 -- 3d16aae1a4a20666151d8a5ebfd48a2777053b75 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 365830995 -- 298f2de7061f21fb94b4bc715bbadef37732d1fa by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 365830862 -- 540c6f4b8f4443d3bb969e566761760813b17545 by Derek Mauro <dmauro@google.com>: Upgrade MacOS CI to use Bazel 3.7.0 PiperOrigin-RevId: 365825990 -- 8b09ef04a1061038a982c3ff29dc7c8a28364f5f by Abseil Team <absl-team@google.com>: internal change PiperOrigin-RevId: 365819242 GitOrigin-RevId: 45c3adace0020bb705e04d254f7b3f914d2ba2e6 Change-Id: I3b2bebd212a41d0c0dda56fefb455240408cc461
* Add missing `add_subdirectory()` call for "cleanup" (#925)Gravatar Christian Blichmann2021-03-30
| | | | | | Since `absl::Cleanup` is now public, it should also be included in the `absl/CMakeLists.txt` file. Signed-off-by: Christian Blichmann <cblichmann@google.com>
* Allowing to change the MSVC runtime (#921)Gravatar WolverinDEV2021-03-30
| | | | | | | | | * Allowing to change the MSVC runtime with the CMake option CMAKE_MSVC_RUNTIME_LIBRARY introduced in 3.15 * Update CMakeLists.txt Capitalize MSVC Co-authored-by: Derek Mauro <761129+derekmauro@users.noreply.github.com>
* Export of internal Abseil changesGravatar Abseil Team2021-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 6b5be2524a088d0f4e8475794dc71232a24e94d8 by Abseil Team <absl-team@google.com>: Enable ABSL_HAVE_ATTRIBUTE_WEAK for Windows with Clang >= 9.0.0 The bug (https://bugs.llvm.org/show_bug.cgi?id=37598) motivated the workaround was fixed in 9.0.0. PiperOrigin-RevId: 365682074 -- c16b7784978a370658dce6d82cb7055316a79bcc by Abseil Team <absl-team@google.com>: Add IsFlat() evaluation to GetFlatAux for RingBuffer PiperOrigin-RevId: 365666501 -- c064eb686a3c036e093e71126c45f97d3a921569 by Abseil Team <absl-team@google.com>: Implement C++11 compatible std::remove_cvref added in C++20 PiperOrigin-RevId: 365606639 -- af2e7e055172da914e63c05308aedb68e197661e by Abseil Team <absl-team@google.com>: Add IsFlat() support to CordRepRing PiperOrigin-RevId: 365562090 -- 2cfeff9280f4967c4f828812bfe153b4e9cbabb7 by Abseil Team <absl-team@google.com>: Make unit test for TryFlat on 'substring of rep' explicit PiperOrigin-RevId: 365081382 GitOrigin-RevId: 6b5be2524a088d0f4e8475794dc71232a24e94d8 Change-Id: Ibb577748176217ce237614a6fe77c05375a97003
* Export of internal Abseil changesGravatar Abseil Team2021-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 3de7250f2988e360764479fa590d299a649987c0 by Derek Mauro <dmauro@google.com>: Make the SOVERSION fit into 16 bits to make the MacOS linker happy PiperOrigin-RevId: 364939757 -- dead27aa0734a89ccb25da807e08e61000a47f8f by Abseil Team <absl-team@google.com>: Update `ABSL_ATTRIBUTE_UNUSED`'s documentation that `[[maybe_unused]]` in C++17 and up is now the preferred usage solution. Also document why we can't update `ABSL_ATTRIBUTE_UNUSED` to use `[[maybe_unused]]` (differences in positioning requirements). PiperOrigin-RevId: 364900016 -- 0baf1b01dc9a2b5f9869ff5a52a1cf7a032055a3 by Abseil Team <absl-team@google.com>: Slightly weaken the spec for `absl::string_view::compare` to match C++17. The Abseil-specific implementation provides a stronger guarantee than required by `std::string_view`, returning +1, 0, or -1. When `absl::string_view` is an alias for `std::string_view`, these are only guaranteed to be positive, zero, and negative. Portable code should not depend on the stronger guarantee. PiperOrigin-RevId: 364846419 GitOrigin-RevId: 3de7250f2988e360764479fa590d299a649987c0 Change-Id: I7c74004fc38c9f5eaad5b104a993b79518497c5b
* Export of internal Abseil changesGravatar Abseil Team2021-03-24
| | | | | | | | | | | | | | | | | | | | -- 4b566a7deeba5db473c83f4924c1d182a002779f by Abseil Team <absl-team@google.com>: Add absl::LeakCheckerIsActive to check whether a leak checker is built into the target and enabled. For LeakSanitizer, it is by default enabled unless __lsan_is_turned_off() is defined and returns true. PiperOrigin-RevId: 364654465 -- 0a56ff5310b66f9d1ff5e5e2a053335ecfb5c75b by Abseil Team <absl-team@google.com>: Update absl::FromTM documentation to reflect implementation. PiperOrigin-RevId: 364388743 GitOrigin-RevId: 4b566a7deeba5db473c83f4924c1d182a002779f Change-Id: I8df35b761b532e79d620f484153083c3499ef55b
* Export of internal Abseil changesGravatar Abseil Team2021-03-22
| | | | | | | | | | | | -- 1e0b6c504e9edc93ac08de320454b0e7f61f2028 by Derek Mauro <dmauro@google.com>: Use ABSL_NO_THREAD_SAFETY_ANALYSIS instead of the no-namespace NO_THREAD_SAFETY_ANALYSIS PiperOrigin-RevId: 363914253 GitOrigin-RevId: 1e0b6c504e9edc93ac08de320454b0e7f61f2028 Change-Id: Iea54f88130d93066e1e4a4747e902f1029500f71
* Export of internal Abseil changesGravatar Abseil Team2021-03-19
| | | | | | | | | | | -- eb820bdf4121c00a60da406333799cda3222ee4d by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 363704749 GitOrigin-RevId: eb820bdf4121c00a60da406333799cda3222ee4d Change-Id: Ia3bca66b12a1abcf96940292ab4cd8d33d712fb5
* Fix C++/CLI build problem (#916)Gravatar Christian Fersch2021-03-18
|
* Export of internal Abseil changesGravatar Abseil Team2021-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 8e75347c10d85112296811be6ef35761744ad9bc by Derek Mauro <dmauro@google.com>: Big update to LTS release process * Add create_lts.py script to to the LTS modification This is simpler than copybara since very few changes are needed * Use the default installation paths instead of a versioned path. If a versioned path is needed, this is easy to change on the commandline. * Make the integration test use the LTS transformed version * Test both static and dynamic linking (fixes pkg-config dynamic linking) PiperOrigin-RevId: 363566934 -- e00e971a2de3138861f5e1900201c9cc7788f714 by Laramie Leavitt <lar@google.com>: Add a non-compile test to absl::BitGenRef for temporaries. PiperOrigin-RevId: 363437284 -- 3685644ec115d99789de32aceb76c32a00756fea by Derek Mauro <dmauro@google.com>: Make OSS code consistent with internal code by using the forward declaration of absl::Status that contains ABSL_MUST_USE_RESULT. PiperOrigin-RevId: 363426906 -- b85fec142c3aa3f632fa985f9f8f73a253819723 by Evan Brown <ezb@google.com>: Move raw_hash_set::infoz_ into raw_hash_set::settings_. This reduces the size of raw_hash_sets by alignof(size_t) bytes when hashtablez is disabled. PiperOrigin-RevId: 363034264 -- c6fde3b17e5845191eb8b2bfc1760c8bfb9573ff by Mark Barolak <mbar@google.com>: Internal change PiperOrigin-RevId: 362990378 -- 81713cf964905b43d1cbe32ce5fed97539029625 by Abseil Team <absl-team@google.com>: Fix typo in comment (execeptions -> exceptions). PiperOrigin-RevId: 362946191 -- 3ee92ca470feca44da417b03ee45a915c6eb5155 by Abseil Team <absl-team@google.com>: Add absl::FindAndReportLeaks and routes it to the corresponding __lsan_do_recoverable_leak_check. PiperOrigin-RevId: 362622199 -- b95b7194b20e02c20d72289fbc79a0d35b82e256 by Abseil Team <absl-team@google.com>: Add `kWithEverything` to StatusToStringMode PiperOrigin-RevId: 362595218 -- 0a960d96a0014eab7e1c55b479269450ed8e98d7 by Abseil Team <absl-team@google.com>: Accept e.g. ".__uniq" as a valid clone name. Further, bring the implementation on par with libiberty's demangler grammar. Clang introduced option -funique-internal-linkage-names that adds the suffix ".__uniq.[0-9]+" to internal linkage functions to give them a globally unique identifier. The suffix was designed to work with existing demanglers which do recognize a "_" along with the alphanumeric string. This change enhances the demangler to allow "_" with the alphanumeric string. Please refer to libiberty's cp-demangle.c where function d_clone_suffix implements the demangling of clone suffixes : 1. '_' is accepted as a valid character with the alphanumeric sequence. 2. The alphanumberic sequence is optional. 3. The digit sequence is optional. PiperOrigin-RevId: 362557420 -- 2ac5ea212c150afd2f58025a5cab8c45d16949c6 by Abseil Team <absl-team@google.com>: Change variable name 'slots' to 'slot_count' to avoid name-clash with Qt builds. PiperOrigin-RevId: 362556289 -- 934f0f409c9c548716a46363d6e243406fad4028 by Mark Barolak <mbar@google.com>: Clarify the comment on ABSL_CACHELINE_SIZE to indicate that the macro definition itself shouldn't change, but rather that call sites should change when possible. This addresses the request for improved documentation in https://github.com/abseil/abseil-cpp/pull/842. PiperOrigin-RevId: 362354288 GitOrigin-RevId: 8e75347c10d85112296811be6ef35761744ad9bc Change-Id: I33ec8561d8d645c3353e9d2dd447501d0e1825a7
* Export of internal Abseil changesGravatar Abseil Team2021-03-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 5ed5dc9e17c66c298ee31cefc941a46348d8ad34 by Abseil Team <absl-team@google.com>: Fix typo. PiperOrigin-RevId: 362040582 -- ac704b53a49becc42f77e4529d3952f8e7d18ce4 by Abseil Team <absl-team@google.com>: Fix a typo in a comment. PiperOrigin-RevId: 361576641 -- d20ccb27b7e9b53481e9192c1aae5202c06bfcb1 by Derek Mauro <dmauro@google.com>: Remove the inline keyword from functions that aren't defined in the header. This may fix #910. PiperOrigin-RevId: 361551300 -- aed9ae1dffa7b228dcb6ffbeb2fe06a13970c72b by Laramie Leavitt <lar@google.com>: Propagate nice/strict/naggy state on absl::MockingBitGen. Allowing NiceMocks reduces the log spam for un-mocked calls, and it enables nicer setup with ON_CALL, so it is desirable to support it in absl::MockingBitGen. Internally, gmock tracks object "strictness" levels using an internal API; in order to achieve the same results we detect when the MockingBitGen is wrapped in a Nice/Naggy/Strict and wrap the internal implementation MockFunction in the same type. This is achieved by providing overloads to the Call() function, and passing the mock object type down into it's own RegisterMock call, where a compile-time check verifies the state and creates the appropriate mock function. PiperOrigin-RevId: 361233484 -- 96186023fabd13d01d32d60d9c7ac4ead1aeb989 by Abseil Team <absl-team@google.com>: Ensure that trivial types are passed by value rather than reference PiperOrigin-RevId: 361217450 -- e1135944835d27f77e8119b8166d8fb6aa25f906 by Evan Brown <ezb@google.com>: Internal change. PiperOrigin-RevId: 361215882 -- 583fe6c94c1c2ef757ef6e78292a15fbe4030e35 by Evan Brown <ezb@google.com>: Increase the minimum number of slots per node from 3 to 4. We also rename kNodeValues (and related names) to kNodeSlots to make it clear that they are about the number of slots per node rather than the number of values per node - kMinNodeValues keeps the same name because it's actually about the number of values rather than the number of slots. Motivation: I think the expected number of values per node, assuming random insertion order, is the average of the maximum and minimum numbers of values per node (kNodeSlots and kMinNodeValues). For large and/or even kNodeSlots, this is ~75% of kNodeSlots, but for kNodeSlots=3, this is ~67% of kNodeSlots. kMinNodeValues (which corresponds to worst-case occupancy) is ~33% of kNodeSlots, when kNodeSlots=3, compared to 50% for even kNodeSlots. This results in higher memory overhead per value, and since this case (kNodeSlots=3) is used when values are large, it seems worth fixing. PiperOrigin-RevId: 361171495 GitOrigin-RevId: 5ed5dc9e17c66c298ee31cefc941a46348d8ad34 Change-Id: I8e33b5df1f987a77112093821085c410185ab51a
* Export of internal Abseil changesGravatar Abseil Team2021-03-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- e2de21d54c02b6419c57c0f4e2a16b608deca260 by Evan Brown <ezb@google.com>: Remove the InsertEnd benchmark. This benchmark has significantly different possible behaviors that can result in misleading metrics. Specifically, we can have a case where we are deallocating the last node in the b-tree in the erase and then allocating a new node in the insert call repeatedly, whereas normally, we end up just inserting/erasing a value from the last node. Also, the name of the benchmark is misleading because it involves an erase and an insert, but the name only mentions the insert. PiperOrigin-RevId: 360930639 -- 51f6bb97b9cbdb809c31b77e93ce080ca3cba9ea by Benjamin Barenblat <bbaren@google.com>: Stop testing with double-double random variables On POWER, long double is often represented as a pair of doubles added together (double-double arithmetic). We’ve already special-cased double-double arithmetic in a number of tests, but compiler bugs [1, 2, 3] have now triggered both false positives and false negatives, which suggests testing with double doubles is unlikely to yield useful signal. Remove the special casing and detect if we’re on a double-double system; if so, just don’t test long doubles. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99048 [2] https://bugs.llvm.org/show_bug.cgi?id=49131 [3] https://bugs.llvm.org/show_bug.cgi?id=49132 PiperOrigin-RevId: 360793161 -- 07fb4d7932c2f5d711c480f759dacb0be60f975e by Abseil Team <absl-team@google.com>: internal change PiperOrigin-RevId: 360712825 GitOrigin-RevId: e2de21d54c02b6419c57c0f4e2a16b608deca260 Change-Id: I98389b5a8789dcc8f35abc00c767e909181665f0
* Export of internal Abseil changesGravatar Abseil Team2021-03-03
| | | | | | | | | | | | | | | | | | | | | | -- a74bdb72c3a6983e08a805938dd0e20e97d55bba by Abseil Team <absl-team@google.com>: Fix typo: calcualte -> calculate PiperOrigin-RevId: 360515509 -- 3ddf8ac194e81a13e9de095e59dd061c1beacfe3 by Benjamin Barenblat <bbaren@google.com>: Make tests tolerant of FMA contraction Weaken Duration.ToDoubleSecondsCheckEdgeCases and Duration.ToDoubleSecondsCheckRandom to make them less sensitive to fused multiply/add contraction. PiperOrigin-RevId: 360297653 GitOrigin-RevId: a74bdb72c3a6983e08a805938dd0e20e97d55bba Change-Id: I0c55383bc13040ea77511c4130d142368103dc57
* Export of internal Abseil changesGravatar Abseil Team2021-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- a9eb3c976c6d8ef4fca3d416847f8fca4bd90dd7 by Derek Mauro <dmauro@google.com>: Remove the deprecated container library, which doesn't do anything. This will help prevent user confusion, as seen in #183. PiperOrigin-RevId: 360172262 -- 4f872f651e25a528bdc59ee4e24543fbbd358f00 by Abseil Team <absl-team@google.com>: Remove unused nspace alias. PiperOrigin-RevId: 359487559 -- 43e877e464886cf9226012f5bb47910b8995e70f by Abseil Team <absl-team@google.com>: Create a StatusToStringMode to control how the ToString behaves. PiperOrigin-RevId: 359339603 -- 0da1291569e167341613359846948c72c8a838e1 by Greg Falcon <gfalcon@google.com>: Fix a bug in SimpleAtoi/SimpleAtof, which accepted a prefix of "+-" (e.g., "+-5" was parsed as 5.0). This regression was introduced when we migrated these functions to use absl::from_chars. PiperOrigin-RevId: 359135105 GitOrigin-RevId: a9eb3c976c6d8ef4fca3d416847f8fca4bd90dd7 Change-Id: I0e2072cad80651e473ba1d34b1fb3a033dfaba80
* Export of internal Abseil changesGravatar Abseil Team2021-02-23
| | | | | | | | | | | -- 32b444c0540e8255cc216171aba57639903edc22 by CJ Johnson <johnsoncj@google.com>: Add missing `final` to `absl::Cleanup` since it is not an interface type and should never be used as a base class. PiperOrigin-RevId: 359045692 GitOrigin-RevId: 32b444c0540e8255cc216171aba57639903edc22 Change-Id: I4f72714cd6f2e101709f31958af28b358f15646b