summaryrefslogtreecommitdiff
path: root/absl/status/status.h
Commit message (Collapse)AuthorAge
* Add non-public API for internal usersGravatar Eric Fiselier2023-05-16
| | | | | PiperOrigin-RevId: 532553508 Change-Id: I813841ff3e5085b64c9b02ca41897bf7f6a8570e
* Fix spelling mistakesGravatar Vertexwahn2023-04-27
|
* remove unused includes and add missing std includes for absl/status/status.hGravatar Abseil Team2022-08-10
| | | | | PiperOrigin-RevId: 466659369 Change-Id: I2bd671ef187604f12371e12a5017cac23fdad35b
* Export of internal Abseil changesGravatar Abseil Team2022-04-19
| | | | | | | | | | | -- 6457ad659de86ce4cae1e9f7cb03a701c6c2851e by Abseil Team <absl-team@google.com>: Introduced ErrnoToStatusCode and ErrnoToStatus to abseil. PiperOrigin-RevId: 442903450 Change-Id: I9c062b34a3811216f43eef56e631eada3b4e3e84 GitOrigin-RevId: 6457ad659de86ce4cae1e9f7cb03a701c6c2851e
* Export of internal Abseil changesGravatar Abseil Team2022-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- d3b99682554d339c42556680f4d65f83226005e2 by Martijn Vels <mvels@google.com>: Inline CycleClock code and remove branch for x86 CycleClockSource function This CL removes the relaxed load for x86 as there is no acquire price to pay on x86. It inlines the UnscaledCycleClock::Now() which is a single RTDSC op for x86, and likewise inlines CycleClock::Now() for x86. The inlining should mostly have secondary benefits such as reducing spills on outlined calls. LTO may eventually hoist these functions inline for the hotspots, but it doesn't hurt to default inline this for all builds and let the compiler decide on the first pass. The perlab benchmark is noisy for the plain BM_Now, but the other benchmarks and the run on my local machine are clear. ------------- Local Benchy Benchmark name old cpu/op new cpu/op delta BM_Now 3.41ns ± 1% 2.30ns ± 2% -32.52% (p=0.000 n=50+50) BM_NowWithRegisterPresure 4.96ns ± 2% 4.19ns ± 2% -15.57% (p=0.000 n=56+55) BM_NowWithCallback 3.30ns ± 2% 1.91ns ± 2% -42.00% (p=0.000 n=47+60) ------------- Perflab Benchy Benchmark name old cpu/op new cpu/op delta BM_Now 8.20ns ±13% 4.32ns ±83% ~ (p=0.413 n=4+5) BM_NowWithRegisterPresure 7.91ns ± 1% 3.68ns ± 2% -53.45% (p=0.029 n=4+4) BM_NowWithCallback 2.66ns ±13% 1.58ns ± 0% -40.51% (p=0.008 n=5+5) PiperOrigin-RevId: 434474766 Change-Id: I991d987ae9233e50f09606c874055cf4c5a56300 -- b38330686a0af176a2679163e4d2fa1b90e2f667 by Laramie Leavitt <lar@google.com>: Style, comment, and test updates * Remove a redundant assert in uniform_real_distribution. * Update comment in internal/generate_real.h * Style updates to uniform_real_distribution_test mainly replacing TypeParam with real_type, using aliases for some limits, etc. * Add a few more minor tests. PiperOrigin-RevId: 433902174 Change-Id: Id75be8e24be2fb8f6aea05feec13e3ef320a7254 -- ab2da6047ff7f5dae3add3779fcddf73b03feabf by Abseil Team <absl-team@google.com>: Remove declaration of method whose definition was previously removed. PiperOrigin-RevId: 433507828 Change-Id: I0130b689813125250f7de2664e767e181f676c89 -- df0c87f4ec2c010691931c1bef9d26470a6e63a2 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 433289136 Change-Id: Iba157dc83ed99dafd17a2223d2504e49f8afbb9e -- 7445fa312f2995772900eda82467325b3401a17d by Martijn Vels <mvels@google.com>: Optimize CordReader logic now that CONCAT is removed This CL cleans up various helper functions and logic remaining from previous complex CONCAT logic that is no longer needed, simplifying the CordReader logic. PiperOrigin-RevId: 433208748 Change-Id: I5f7b1883573c44e7c6f8af12c3cddbd197cb134d GitOrigin-RevId: d3b99682554d339c42556680f4d65f83226005e2
* Export of internal Abseil changesGravatar Abseil Team2022-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 91d76b3ac9edff91f206d9eee60423c39eeeaf93 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 430442277 -- 9f8a87bcc5cc5b0fd8b7f0318f37d152fd8bea06 by Evan Brown <ezb@google.com>: Small refactoring to work towards allowing for node_btree_* containers. - Change common_params::transfer to rely on slot_policy transfer instead of manually doing construct/destruct. Transfer is not construct/destruct for node containers. - Move maps' value_compare into btree.h from btree_map.h so it can be reused for node_btree_map.h. - Also add a test for maps' value_compare protected members. PiperOrigin-RevId: 430245542 -- 0126e0b6295342317d9c9f0a66e2d7009b858426 by Martijn Vels <mvels@google.com>: Add CordRepSubString::Create function with hard checks on IsFlat() | IsExternal() This hardens internal invariants, IsFlat() || IsExternal() is a cheap, single predicted branch, and removes boilerplate code from cord.cc PiperOrigin-RevId: 429676041 -- ed98a92af49d9e238d9f1d1b69fb4eddcd1ccbc7 by Abseil Team <absl-team@google.com>: tweaks to status.h documentation to reflect general-purpose communication PiperOrigin-RevId: 429584104 GitOrigin-RevId: 91d76b3ac9edff91f206d9eee60423c39eeeaf93 Change-Id: I54d6d116a564f86a842b983ca76559bf9b388f72
* Export of internal Abseil changesGravatar Abseil Team2022-01-28
| | | | | | | | | | | | | | | | | | | -- ef2bdebfdff0a93d3af6248d709d42a47fe2e7b4 by Derek Mauro <dmauro@google.com>: Compile with -DGTEST_REMOVE_LEGACY_TEST_CASEAPI_ in Bazel CI builds to prevent uses of the legacy TestCase API from sneaking in PiperOrigin-RevId: 424882792 -- 4cf19d7b4dd855685deb0d4d3170e4db9f6f789b by Abseil Team <absl-team@google.com>: Fix typo in comment. PiperOrigin-RevId: 424745867 GitOrigin-RevId: ef2bdebfdff0a93d3af6248d709d42a47fe2e7b4 Change-Id: I50ad9b4cf3fa17831aa6521c58d81b0ce8ec0c47
* Export of internal Abseil changesGravatar Abseil Team2021-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 355b8f7b0070b005d53d94ee4180e95559ba2c88 by Derek Mauro <dmauro@google.com>: Documentation: don't define absl::Status::ok() in terms of itself Fixes #1058 PiperOrigin-RevId: 410035651 -- 31c512c834b3a8979297adc5006c3727a3c6554b by Evan Brown <ezb@google.com>: Cleanup: move set_params/set_slot_policy into btree_set.h and move map_params into btree_map.h. Also change some `sizeof(value_type)`s to `sizeof(slot_type)`s and update some comments/variable names referring to values to refer to slots as appropriate in btree.h. Motivation: preliminary cleanup towards node_btree_*. PiperOrigin-RevId: 409991342 -- 3129ca320d61a82f1c9ee8c02a23d25024eea4ab by Abseil Team <absl-team@google.com>: Use simpler implementation for AddressIsReadable. In particular, current solution doesn't work on systems configured with large pid_t space. PiperOrigin-RevId: 409397716 -- f71067f7494b19ce4a2e1df730b934dc931c51b2 by Martijn Vels <mvels@google.com>: Add Span dependency PiperOrigin-RevId: 409198889 GitOrigin-RevId: 355b8f7b0070b005d53d94ee4180e95559ba2c88 Change-Id: I7f4df3ec7739fdfde61d8ba983f07a08f6f1c7d7
* Export of internal Abseil changesGravatar Abseil Team2021-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- b008f3aaab60f1f0eb5987b50336543cca7151be by Martijn Vels <mvels@google.com>: Enable Cord Btree as the default Cord implementation. The Cord Btree implementation has been extensively tested by google. This changes makes the Cord Btree implementation the default implementation. This change should have no impact on current use cases and does not effect any public API or behavior. PiperOrigin-RevId: 403966449 -- 3d82052b5819d1244942c59d5cb4e51d75ada287 by Derek Mauro <dmauro@google.com>: Add missing CMake alias for gmock_main. Remove unused variable ABSL_TEST_COMMON_LIBRARIES Fixes #709 Fixes #1043 PiperOrigin-RevId: 403950358 -- 86695f6d06915b56d807303c37ee81487998cd58 by Abseil Team <absl-team@google.com>: FunctionRef is cheaper to construct than a std::function, and the argument is only used during the call, so this is safe. This has the added advantage of allowing the caller to provide a non-movable callable, which can't be converted to a std::function. PiperOrigin-RevId: 403457615 -- 196c1109ba519d4ff00c856bbb4bff754468359f by Abseil Team <absl-team@google.com>: Internal optimization. PiperOrigin-RevId: 403413291 GitOrigin-RevId: b008f3aaab60f1f0eb5987b50336543cca7151be Change-Id: I1665f0efd484f53e0ed22d8940ef2fa60b03cc5b
* Export of internal Abseil changesGravatar Abseil Team2021-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 17141711ee419daa597a9f31e73721f80143e55a by Gennadiy Rozental <rogeeff@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 401384949 -- ac48584a7b16e8a12e26d49deb6cddec584a20b5 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 401337785 -- 8a51bb7c962845e0707240c5ba12c1b80f6fbbe9 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 401047691 -- 8e18024510869247f3c04c7807c93709eca2322a by Chris Kennelly <ckennelly@google.com>: Note that SpinLock does not guarantee priorities for wakeups. PiperOrigin-RevId: 400999238 -- 75bc09b5f95fbb74b74d14c370bfb80011e8fb7f by Derek Mauro <dmauro@google.com>: Add visibility restrictions to some internal targets PiperOrigin-RevId: 400718253 -- 1de5061016bc42cd7be009c9725ed2343ce12e3d by Abseil Team <absl-team@google.com>: Make it clear that operator<< can also be used in place of ToString when logging absl::Status. PiperOrigin-RevId: 400248269 -- cda15d9dc6e5cd569de7e5e73f409b72a3caed51 by Abseil Team <absl-team@google.com>: Minor cleanup PiperOrigin-RevId: 400087535 -- b001375ec47da3a0434be9ca9a45c0df510e7dda by Abseil Team <absl-team@google.com>: Move periodic_sampler from base/internal to profiling/internal PiperOrigin-RevId: 400038533 -- e7e02e686abc3900e723080849a3607d190ef57f by Abseil Team <absl-team@google.com>: Move exponential_biased from base/internal to profiling/internal PiperOrigin-RevId: 400020329 GitOrigin-RevId: 17141711ee419daa597a9f31e73721f80143e55a Change-Id: I10924df7e1cc198447813dbe97a374a5cef66b49
* Fixed typo `constuct` to `construct` in 3 places. (#1022)Gravatar Martin Blais2021-09-27
|
* Export of internal Abseil changesGravatar Abseil Team2021-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 69b5d0b2a5adb49a53e51f9da6848eaa484242fe by Derek Mauro <dmauro@google.com>: Changes the absl::Duration factory functions to disallow types that are convertible to int or double, instead requiring that the argument itself is indeed an integer or a floating-point number. This will prevent callers from passing arguments, such as std::atomic<T>. This change is an API break. Information and a tool to fix issues can be found at https://abseil.io/docs/cpp/tools/upgrades/duration-conversions PiperOrigin-RevId: 387153494 -- 786063e438ab6a55ac4baa88ad4d20a8293be52a by Evan Brown <ezb@google.com>: Make ctrl_t be an enum class. This adds type safety, and also when strict aliasing is enabled, the compiler will know that control bytes can't alias non-control bytes. Also make H2() return h2_t. PiperOrigin-RevId: 387120717 -- 7e537aabec1c255d6e7c9d21232c597c1c2077bf by Evan Brown <ezb@google.com>: Add some missing `const` keywords to ctrl_t* function parameters. PiperOrigin-RevId: 386976062 -- da53ac6d91cabd951e81dd0a145e1e52b918955f by Martijn Vels <mvels@google.com>: Change Seek and InitOffset to return nullptr instead of assert / fail. This makes it consistent with the rest of the API (Next, Previous, Skip) and hardens it against invariants that are harder (or less likey) to be upheld correctly by the caller. PiperOrigin-RevId: 386963283 -- a4d1faac020d5025edf53ce81808e5db68da7d89 by Abseil Team <absl-team@google.com>: PC / Backtrace / Symbolization for Emscripten. PiperOrigin-RevId: 386957724 -- 97f2c47d83ba9d3ac89e1f55bd06897686ffd063 by Martijn Vels <mvels@google.com>: Fix static casts ([-Wimplicit-int-conversion]) PiperOrigin-RevId: 386951646 -- 9530c795248543817cbc4013953baa09c35f5e1a by Abseil Team <absl-team@google.com>: Fix incorrect header guard in cord_rep_btree_navigator.h PiperOrigin-RevId: 386907904 -- 90ce5872406df2b7f4c428683741dc13a572267e by Abseil Team <absl-team@google.com>: Small grammar fixes for some StatusCode descriptions. PiperOrigin-RevId: 386906217 -- b30a2fd777f12a04a4d512f37a34614b0d05ce99 by Derek Mauro <dmauro@google.com>: Skip length checking when constructing absl::string_view from std::string. The length check causes unnecessary code bloat. PiperOrigin-RevId: 386857974 -- fa171536c359bfa2a1b80297e844519bb9ee7791 by Martijn Vels <mvels@google.com>: Introduce CordRepBtreeNavigator CordRepBtreeNavigator implements bi-directional navigation over all data edges stored inside a Cord Btree. PiperOrigin-RevId: 386519102 GitOrigin-RevId: 69b5d0b2a5adb49a53e51f9da6848eaa484242fe Change-Id: I1b35188d66133f8cb73d346bc5564aac4e0b3e80
* 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-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-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-01-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- c68f1886f5e8fd90eb0c2d2e68feaf00a7cdacda by CJ Johnson <johnsoncj@google.com>: Introduce absl::Cleanup to the OSS repo PiperOrigin-RevId: 354583156 -- 17030cf388e10f7eb959e3e566326d1072ce392e by Abseil Team <absl-team@google.com>: Internal change only PiperOrigin-RevId: 354574953 -- e979d7236d4f3252e79ddda6739b67a9a326bf6d by CJ Johnson <johnsoncj@google.com>: Internal change PiperOrigin-RevId: 354545297 -- 7ea02b3783f7f49ef97d86a8f6580a19cc57df14 by Abseil Team <absl-team@google.com>: Pre-allocate memory for vectors where the size is known. PiperOrigin-RevId: 354344576 -- 9246c7cb11f1d6444f79ebe25acc69a8a9b870e0 by Matt Kulukundis <kfm@google.com>: Add support for Elbrus 2000 (e2k) Import of https://github.com/abseil/abseil-cpp/pull/889 PiperOrigin-RevId: 354344013 -- 0fc93d359cc1fb307552e917b37b7b2e7eed822f by Abseil Team <absl-team@google.com>: Integrate CordRepRing logic into cord (but do not enable it) PiperOrigin-RevId: 354312238 -- eda05622f7da71466723acb33403f783529df24b by Abseil Team <absl-team@google.com>: Protect ignore diagnostic with "__has_warning". PiperOrigin-RevId: 354112334 -- 47716c5d8fb10efa4fdd801d28bac414c6f8ec32 by Abseil Team <absl-team@google.com>: Rearrange InlinedVector copy constructor and destructor to treat a few special cases inline and then tail-call a non-inlined routine for the rest. In particular, we optimize for empty vectors in both cases. Added a couple of benchmarks that copy either an InlVec<int64> or an InlVec<InlVec<int64>>. Speed difference: ``` BM_CopyTrivial/0 0.92ns +- 0% 0.47ns +- 0% -48.91% (p=0.000 n=11+12) BM_CopyTrivial/1 0.92ns +- 0% 1.15ns +- 0% +25.00% (p=0.000 n=10+9) BM_CopyTrivial/8 8.57ns +- 0% 10.72ns +- 1% +25.16% (p=0.000 n=10+12) BM_CopyNonTrivial/0 3.21ns +- 0% 0.70ns +- 0% -78.23% (p=0.000 n=12+10) BM_CopyNonTrivial/1 5.88ns +- 1% 5.51ns +- 0% -6.28% (p=0.000 n=10+8) BM_CopyNonTrivial/8 21.5ns +- 1% 15.2ns +- 2% -29.23% (p=0.000 n=12+12) ``` Note: the slowdowns are a few cycles which is expected given the procedure call added in that case. We decided this is a good tradeoff given the code size reductions and the more significant speedups for empty vectors. Size difference (as measured by nm): ``` BM_CopyTrivial from 1048 bytes to 326 bytes. BM_CopyNonTrivial from 749 bytes to 470 bytes. ``` Code size for a large binary drops by ~500KB (from 349415719 to 348906015 348906191). All of the benchmarks that showed a significant difference: Ones that improve with this CL: ``` BM_CopyNonTrivial/0 3.21ns +- 0% 0.70ns +- 0% -78.23% (p=0.000 n=12+10) BM_InlinedVectorFillString/0 0.93ns +- 0% 0.24ns +- 0% -74.19% (p=0.000 n=12+10) BM_InlinedVectorAssignments/1 10.5ns +- 0% 4.1ns +- 0% -60.64% (p=0.000 n=11+10) BM_InlinedVectorAssignments/2 10.7ns +- 0% 4.4ns +- 0% -59.08% (p=0.000 n=11+11) BM_CopyTrivial/0 0.92ns +- 0% 0.47ns +- 0% -48.91% (p=0.000 n=11+12) BM_CopyNonTrivial/8 21.5ns +- 1% 15.2ns +- 2% -29.23% (p=0.000 n=12+12) BM_StdVectorEmpty 0.47ns +- 1% 0.35ns +- 0% -24.73% (p=0.000 n=12+12) BM_StdVectorSize 0.46ns +- 2% 0.35ns +- 0% -24.32% (p=0.000 n=12+12) BM_SwapElements<LargeCopyableOnly>/0 3.44ns +- 0% 2.76ns +- 1% -19.83% (p=0.000 n=11+11) BM_InlinedVectorFillRange/256 20.7ns +- 1% 17.8ns +- 0% -14.08% (p=0.000 n=12+9) BM_CopyNonTrivial/1 5.88ns +- 1% 5.51ns +- 0% -6.28% (p=0.000 n=10+8) BM_SwapElements<LargeCopyableMovable>/1 4.19ns +- 0% 3.95ns +- 1% -5.63% (p=0.000 n=11+12) BM_SwapElements<LargeCopyableMovableSwappable>/1 4.18ns +- 0% 3.99ns +- 0% -4.70% (p=0.000 n=9+11) BM_SwapElements<LargeCopyableMovable>/0 2.41ns +- 0% 2.31ns +- 0% -4.45% (p=0.000 n=12+12) BM_InlinedVectorFillRange/64 8.25ns +- 0% 8.04ns +- 0% -2.51% (p=0.000 n=12+11) BM_SwapElements<LargeCopyableOnly>/1 82.4ns +- 0% 81.5ns +- 0% -1.06% (p=0.000 n=12+12) ``` Ones that get worse with this CL: ``` BM_CopyTrivial/1 0.92ns +- 0% 1.15ns +- 0% +25.00% (p=0.000 n=10+9) BM_CopyTrivial/8 8.57ns +- 0% 10.72ns +- 1% +25.16% (p=0.000 n=10+12) BM_SwapElements<LargeCopyableMovableSwappable>/512 1.48ns +- 1% 1.66ns +- 1% +11.88% (p=0.000 n=12+12) BM_InlinedVectorFillString/1 11.5ns +- 0% 12.8ns +- 1% +11.62% (p=0.000 n=12+11) BM_SwapElements<LargeCopyableMovableSwappable>/64 1.48ns +- 2% 1.66ns +- 1% +11.66% (p=0.000 n=12+11) BM_SwapElements<LargeCopyableMovableSwappable>/1k 1.48ns +- 1% 1.65ns +- 2% +11.32% (p=0.000 n=12+12) BM_SwapElements<LargeCopyableMovable>/512 1.48ns +- 2% 1.58ns +- 4% +6.62% (p=0.000 n=11+12) BM_SwapElements<LargeCopyableMovable>/1k 1.49ns +- 2% 1.58ns +- 3% +6.05% (p=0.000 n=12+12) BM_SwapElements<LargeCopyableMovable>/64 1.48ns +- 2% 1.57ns +- 4% +6.04% (p=0.000 n=11+12) BM_InlinedVectorFillRange/1 4.81ns +- 0% 5.05ns +- 0% +4.83% (p=0.000 n=11+11) BM_InlinedVectorFillString/8 79.4ns +- 1% 83.1ns +- 1% +4.64% (p=0.000 n=10+12) BM_StdVectorFillString/1 16.3ns +- 0% 16.6ns +- 0% +2.13% (p=0.000 n=11+8) ``` PiperOrigin-RevId: 353906786 -- 8e26518b3cec9c598e5e9573c46c3bd1b03a67ef by Abseil Team <absl-team@google.com>: Internal change PiperOrigin-RevId: 353737330 -- f206ae0983e58c9904ed8b8f05f9caf564a446be by Matt Kulukundis <kfm@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 353682256 GitOrigin-RevId: c68f1886f5e8fd90eb0c2d2e68feaf00a7cdacda Change-Id: I5790c1036c4f543c701d1039848fabf7ae881ad8
* Export of internal Abseil changesGravatar Abseil Team2020-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 6e9f93888bbe6718997ed90bbd049f1f3572b066 by Abseil Team <absl-team@google.com>: Fix status to be safe for self move assignment. PiperOrigin-RevId: 346815392 -- 35cae74a977f258e81dfbe925fb5a34cb6632036 by Gennadiy Rozental <rogeeff@google.com>: Eliminate unnecessary access to the global vars. PiperOrigin-RevId: 346777168 -- e7e786c243069060f5d6c1c945decb4b0b83f95b by Andy Getzendanner <durandal@google.com>: Internal change. PiperOrigin-RevId: 346685656 -- 4ccd41c48f1a83cfa20b3ea534f743dd7d788376 by Abseil Team <absl-team@google.com>: Move CordRep Ref() and Unref() logic into cord_internal.h This change moves Ref() and Unref() logic out of cord.cc into cord_internal. The main purpose is to make upcoming ring buffer changes easier to isolate from existing cord.cc code. Notice that this removes the nullptr check from Unref() and now requires it to be non null (which held true most times). We may need to rethink if the 'unref unlikely one' is the common case: are cordreps most likely shared? This may be something between 'root' and non root nodes, i.e., is it more likely for leaf / flat nodes in large cords to be shared than top level cordreps being shared? Vice versa? Benchmarks say that we mostly shouldn't care, the caveat being that atomic ops seem more expensive on upcoming archs (arcadia) so we should error on the side of an extra IsOne() branch saving us single owned atomic ops. PiperOrigin-RevId: 346676121 -- f0babab103b9e60d61ba09482d468985e43eceb3 by Samuel Benzaquen <sbenza@google.com>: Fix iterator based constructor and `.insert` members to only require EmplaceConstructible as the standard specifies. PiperOrigin-RevId: 346616707 -- 8f48eedda02277f9c96a88ed7726e34b557cce20 by Evan Brown <ezb@google.com>: Fix a bug in binary_search_impl when there's a transparent, three-way comparator that has different equivalence classes for different lookup types. Add a new can_have_multiple_equivalent_keys method to share the common logic for these cases. PiperOrigin-RevId: 346605948 -- 649183cb3cc9383431de9c81fb1c0f885d4001ae by Abseil Team <absl-team@google.com>: Add benchmark for accessing a Duration flag. PiperOrigin-RevId: 346594843 -- fefdb046520871af63ce2229e2f7cccfc0483dea by Abseil Team <absl-team@google.com>: Restructure CordReader for upcoming ring buffer changes. PiperOrigin-RevId: 346410642 -- 8b2f50e7da0ebab06ead5f94e366e984ca23cb6a by Abseil Team <absl-team@google.com>: Wire in an internal-only flag to toggle upcoming ring buffer changes on/off for experimentation. PiperOrigin-RevId: 346199111 GitOrigin-RevId: 6e9f93888bbe6718997ed90bbd049f1f3572b066 Change-Id: I8f34866b25a79209cb5448bbb28dd3044111d2e9
* Export of internal Abseil changesGravatar Abseil Team2020-12-01
| | | | | | | | | | | | | | | | | | | | | -- 7b6a68aa92dcc7247236d1a1813914e035383bf8 by Abseil Team <absl-team@google.com>: Use atomic exchange to mark completion in absl::once_flag This prevents a potential for a missed wakeup if one thread marks itself as a waiter while another thread is completing the invocation. PiperOrigin-RevId: 344946791 -- ddff21d1dde08d1368d8be5fca81b154e78be2fc by Abseil Team <absl-team@google.com>: Add missing string_view include. This is currently used transitively through the cord header. PiperOrigin-RevId: 344845266 GitOrigin-RevId: 7b6a68aa92dcc7247236d1a1813914e035383bf8 Change-Id: Ia24e98a1df832fc4cb491d888fdf21182b5954f4
* Export of internal Abseil changesGravatar Abseil Team2020-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | -- dad7313f7e8c36c35fc213ce5110100595f90990 by Andy Getzendanner <durandal@google.com>: Fix log_severity.h header guard to match path. PiperOrigin-RevId: 334439123 -- 8a58aa0f4171219d38fb49a2e008e249f86de4cb by Abseil Team <absl-team@google.com>: Minor comment cleanup PiperOrigin-RevId: 334409054 -- a1bc324e53c358b874f99b3f5624658fff99453e by Evan Brown <ezb@google.com>: Cleanup in btree.h: - Combine internal_locate_impls and update comments. - Avoid use of auto with SearchResult. - Change one iterator reference to be stored by value (copy is cheap). PiperOrigin-RevId: 334396951 GitOrigin-RevId: dad7313f7e8c36c35fc213ce5110100595f90990 Change-Id: I79862795abd3169587f5bafe0e5369bdde90c1e1
* Export of internal Abseil changesGravatar Abseil Team2020-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | -- 1829e203300191671abd4b478ca189019e6f88b1 by Abseil Team <absl-team@google.com>: Don't return true from Demangle() when we didn't actually produce demangled output. PiperOrigin-RevId: 332544020 -- 239b617bd8322cfda69d0dcdd3d78499ed61206d by Abseil Team <absl-team@google.com>: Minor documentation fix. PiperOrigin-RevId: 332517877 -- d566c156619bbdceaf6e84bd0d3aa575d5e790f8 by Gennadiy Rozental <rogeeff@google.com>: Added missing asserts for seq.index() < capacity_ and unified their usage based on has_element(). Import of https://github.com/abseil/abseil-cpp/pull/781 PiperOrigin-RevId: 332229369 GitOrigin-RevId: 1829e203300191671abd4b478ca189019e6f88b1 Change-Id: I5bb1f713497fef54a7abaf2020be91cb32e87b93
* Export of internal Abseil changesGravatar Abseil Team2020-09-08
| | | | | | | | | | | | | | | | | | -- 306a7201c5d9fd2fa5bd4f50ea46a61e1f69925b by Abseil Team <absl-team@google.com>: Minor documentation cleanup. PiperOrigin-RevId: 330546393 -- f62a256057797d0a85715ed944760fa62e1ce7a1 by Abseil Team <absl-team@google.com>: Fix typo in comment abls:: -> absl:: PiperOrigin-RevId: 330286163 GitOrigin-RevId: 306a7201c5d9fd2fa5bd4f50ea46a61e1f69925b Change-Id: I9ac174396d1b0fcf9b3e0b8a2b00e088b3eb69cd
* Export of internal Abseil changesGravatar Abseil Team2020-09-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 8ae3cb636b81b6498ef30fbe59cc102a4098cad2 by Tom Manshreck <shreck@google.com>: Upgrade absl::StatusOr<T> docs to Abseil standards PiperOrigin-RevId: 329975341 -- 7c7baf586c7380497a751f1a186a4ef0e650161a by Tom Manshreck <shreck@google.com>: Update absl::Status to Abseil documentation standards PiperOrigin-RevId: 329942967 -- 6710d022ba987dbae7a5d83045a6697afeb972c4 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 329775111 -- fd182dc699e18522ef16d269731c57669c5487d2 by Abseil Team <absl-team@google.com>: Google-internal change. PiperOrigin-RevId: 329737362 -- c0df5e27ffb48d9c784e7019267580fcb4a3f92e by Xiaoyi Zhang <zhangxy@google.com>: Remove obsolete `static_assert`. PiperOrigin-RevId: 329727604 GitOrigin-RevId: 8ae3cb636b81b6498ef30fbe59cc102a4098cad2 Change-Id: Ic9dede0ab97f799e7f4093fae75ae0ec6cc21437
* Export of internal Abseil changesGravatar Abseil Team2020-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- ea5599482a5120800f060c6d41334dbdbabc3941 by Mark Barolak <mbar@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 329715235 -- e897a582bed3aff509b98e5da0711b2afd15ed17 by Tom Manshreck <shreck@google.com>: * Update Status with overview * Move public API helper functions out of "Implementation Details" * Add documentation to Status Codes PiperOrigin-RevId: 329595541 -- f93b28596f24fa005606565e0a8a4dabe260b01c by Abseil Team <absl-team@google.com>: Fix -Wextra-semi issues. ABSL_COMPARE_INLINE_xxx_DECL may expand to nothing. That produces structs that have only semicolon inside class declaration. such struct is not a valid c++ code and fails to compile when -Wextra-semi is turned on. PiperOrigin-RevId: 329564534 GitOrigin-RevId: ea5599482a5120800f060c6d41334dbdbabc3941 Change-Id: Icc9944c3ec8303abc26a167c2ba7c91e59a4877f
* Export of internal Abseil changesGravatar Abseil Team2020-08-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 0c8282d75798c77733eee6167870bcc6acc0bfc1 by Evan Brown <ezb@google.com>: Provide mutable access to the key in node handles using std::launder when compiled with C++17 or later. Also, document why we can't provide mutable access to the key without C++17. Note: we use Policy::mutable_key() because btree already uses Policy::key() internally to get const key access, and we want to avoid calling std::launder unless we need mutable access to the key. PiperOrigin-RevId: 326519000 -- 8018d0c3044400f0a731b0d2d00b606742c98818 by Xiaoyi Zhang <zhangxy@google.com>: Move `Status` internal symbols from the public header into an internal header file. PiperOrigin-RevId: 326471847 -- 87a7644864ba7c003b0611898aaba1b71c840376 by Abseil Team <absl-team@google.com>: Avoid a costly divide (the division accounts for 10% of the time spent in the function). When the division is signed, the compiler has to generate a div. When it is unsigned, it can generate a shift: https://godbolt.org/z/vGfTv4. As per the test above the div, we know that the value is unsigned. PiperOrigin-RevId: 326453275 GitOrigin-RevId: 0c8282d75798c77733eee6167870bcc6acc0bfc1 Change-Id: I0a953558358055ab3dc6a533d8930698509b1195
* Export of internal Abseil changesGravatar Abseil Team2020-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 8726480d631a3736347f542dab5628d5e2ace3c1 by Mark Barolak <mbar@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 323414814 -- abc4a382a29fb857432e0e13a8c21ebe808f9828 by Abseil Team <absl-team@google.com>: Fix buffer overflow when the result of demangling doesn't fit. PiperOrigin-RevId: 323392968 -- 7ed3e514519a971322d0a3333c7e85ed1f2a5f71 by Gennadiy Rozental <rogeeff@google.com>: Move ABSL_DEPRECATED and ABSL_FALLTHROUGH_INTENDED from base.h into attribute.h. PiperOrigin-RevId: 323137526 -- fc0afdb0792d565065d25feb9680972218355f90 by Xiaoyi Zhang <zhangxy@google.com>: Add documentation for `absl::StatusCode`. PiperOrigin-RevId: 323065623 GitOrigin-RevId: 8726480d631a3736347f542dab5628d5e2ace3c1 Change-Id: I9d39650e49ff265cd2dafee302013694e97c813f
* Export of internal Abseil changesGravatar Abseil Team2020-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 2aa4544070113a4943f93464df74759f043bab92 by CJ Johnson <johnsoncj@google.com>: Spelling fix in InlinedVector PiperOrigin-RevId: 308241764 -- 0d8a8ff71023df845c490c73811da598a42f12d9 by Todd Jackson <tjackson@google.com>: Fix CMake warnings on absl/types/CMakeLists.txt. PiperOrigin-RevId: 308123331 -- f35fbd79437ba999097b1499770103b7865078e5 by Samuel Benzaquen <sbenza@google.com>: Speed up the integral printer. PiperOrigin-RevId: 308081531 -- b1676b869ed0547e1cca23c83bb370f459bdf2cb by Samuel Benzaquen <sbenza@google.com>: Collapse the template arguments to enums earlier to reduce the number of instantiations of FormatSpecTemplate. This doesn't affect opt builds much, but reduces the bloat in non-opt builds. PiperOrigin-RevId: 308066155 -- edda0c227adad392cfff2af6ed532822c481f013 by Abseil Team <absl-team@google.com>: Minor documentation fix for `absl::Status` CTOR. PiperOrigin-RevId: 308037725 -- 8326b85569f0fdb15632b0076e38baba4c69794b by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 307914168 GitOrigin-RevId: 2aa4544070113a4943f93464df74759f043bab92 Change-Id: I553ce3838c5e35d04954f560dc75ec24033919af
* Export of internal Abseil changesGravatar Abseil Team2020-03-10
| | | | | | | | | | | -- ea0cfebeb69b25bec343652bbe1a203f5476c51a by Mark Barolak <mbar@google.com>: Change "std::string" to "string" in places where a "std::" qualification was incorrectly inserted by automation. PiperOrigin-RevId: 300108520 GitOrigin-RevId: ea0cfebeb69b25bec343652bbe1a203f5476c51a Change-Id: Ie3621e63a6ebad67b9fe56a3ebe33e1d50dac602
* Export of internal Abseil changesGravatar Abseil Team2020-02-20
-- bffb14058bb46137d42c7a113a36b6b582997cda by Xiaoyi Zhang <zhangxy@google.com>: Add ABSL_MUST_USE_RESULT to Status. PiperOrigin-RevId: 296272498 -- b426fdd3b3f687d7a8aeb644925923bbab503778 by CJ Johnson <johnsoncj@google.com>: Optimizes absl::InlinedVector::clear() by not deallocating the data, if allocated. This allows allocations to be reused. This matches the behavior of std::vector::clear() PiperOrigin-RevId: 296197235 -- 8cb9fbfe20e749816065c1a042e84f72dac9bfc0 by CJ Johnson <johnsoncj@google.com>: Optimizes absl::InlinedVector::clear() by not deallocating the data, if allocated. This allows allocations to be reused. This matches the behavior of std::vector::clear() PiperOrigin-RevId: 296058092 -- 2558d3369a482879919155b6f46317ccafe0ca13 by Matthew Brown <matthewbr@google.com>: Internal cleanup PiperOrigin-RevId: 296025806 -- cf7ee57228534021c15ed7421df92acf6c27c9c7 by Gennadiy Rozental <rogeeff@google.com>: Make FlagOps enum class. We also add comments to all the functions used to invoke flag ops. PiperOrigin-RevId: 295975809 -- 74bbdbd12fbc54e9c4ebcb3005e727becf0e509d by Xiaoyi Zhang <zhangxy@google.com>: Release `absl::Status`. PiperOrigin-RevId: 295777662 -- 3dbc622b4e2227863525da2f7de7ecbeb3ede21f by Xiaoyi Zhang <zhangxy@google.com>: Internal change. PiperOrigin-RevId: 295733658 -- 48d74aa0ab01d611da6012b377f038d8b26c712e by Abseil Team <absl-team@google.com>: Fix typo in container/CMakeLists.txt for container_common PiperOrigin-RevId: 295491438 GitOrigin-RevId: bffb14058bb46137d42c7a113a36b6b582997cda Change-Id: Ia966857b07fa7412cd6489ac37b5fa26640e4141