summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* inlined_vector: fix incorrect conditions for move constructor fast paths.Gravatar Aaron Jacobs2023-03-29
| | | | | | | | | These have nothing to do with copy construction or copy assignment, and using "is trivially copy constructible" can in theory even give the wrong result if the copy constructor is trivial but the move constructor is not. PiperOrigin-RevId: 520488816 Change-Id: I6da4d57f3ce23b03044e0bf9aa70a14b51651fa3
* Import of CCTZ from GitHub.Gravatar Abseil Team2023-03-28
| | | | | PiperOrigin-RevId: 520197681 Change-Id: I96d0253b61bb683bf30060a9b4c19e2c9dce629b
* Fix flakiness issues in timing tests.Gravatar Evan Brown2023-03-27
| | | | | PiperOrigin-RevId: 519939158 Change-Id: I9b049fa55167ed4064f3909887eec7bc52601677
* type_traits: don't use __is_trivially_relocatable with Clang on Windows.Gravatar Aaron Jacobs2023-03-27
| | | | | | | | | | | | | It currently gives the wrong result for types with a user-provided destructor: struct S { ~S(); }; static_assert(!__is_trivially_relocatable(S)); PiperOrigin-RevId: 519855600 Change-Id: I5f0659ad0831974805a5ed4b615e3b6250d23154
* inlined_vector: destroy all types with trivial destructors efficiently.Gravatar Aaron Jacobs2023-03-27
| | | | | | | | | There's no reason to require the type to be trivially copy-constructible/assignable in order to avoid running destructors—those traits have nothing to do with destruction. PiperOrigin-RevId: 519822201 Change-Id: I2ed7bbb53f0c1a512017115ff29fb27a24c6b11a
* absl int128: avoid shifting signed integer by a number of bits greater than ↵Gravatar Abseil Team2023-03-27
| | | | | | | or equal to the precision of the operand PiperOrigin-RevId: 519808237 Change-Id: I9123b167b606d609b8f3924d6f4fd298fa866a90
* Import of CCTZ from GitHub.Gravatar Abseil Team2023-03-27
| | | | | PiperOrigin-RevId: 519786979 Change-Id: Ic5b69c1ac37b47db01d613edca5504e6611657b5
* type_traits: provide a better fallback for is_trivially_relocatable.Gravatar Abseil Team2023-03-24
| | | | | | | | | | We can do a lot better than always saying "no" on platforms without the __is_trivially_relocatable builtin. This will allow using this type trait from the move constructors of InlinedVector in a future CL, without needing to open code the fallback logic. PiperOrigin-RevId: 519281125 Change-Id: I0d55f019331966f58074850d6f77c7eab49f2c53
* inlined_vector: get rid of IsMemcpyOk.Gravatar Abseil Team2023-03-24
| | | | | | | | | | | | | | This type trait had no precise definition, and indeed not even any documentation at all. Giving the ill-defined concept a name was harmful, because it obscured several places where the concept was used too conservatively, or even flat-out incorrectly. This CL has no behavior change: it simply expands IsMemcpyOk to the same conditions it previously had. It leaves TODOs for each place where this was too conservative or incorrect. PiperOrigin-RevId: 519278325 Change-Id: I25bc89f299f6e40b5c3bce7370ed90f33a95612f
* type_traits: touch up the docs for is_trivially_relocatable.Gravatar Abseil Team2023-03-24
| | | | | | | | | | | Clarify that the trait is conservative: it's safe to act on if it's true, but false doesn't necessarily mean anything. Of course this is the only reasonable way to use it, but I think it's helpful to be explicit, especially because currently this trait *always* returns false on some platforms even for a type like int. PiperOrigin-RevId: 519272294 Change-Id: Ic63a48dcf18efc0756046b3d6f51d11cbb46a469
* inlined_vector_test: add coverage of moving vectors of unique pointers.Gravatar Abseil Team2023-03-24
| | | | | | | | std::unique_ptr is trivially relocatable, but not trivially destructible. This will be important coverage to ensure correctness of upcoming commit(s) that expand the use of memcpy to more trivially relocatable types. PiperOrigin-RevId: 519270234 Change-Id: I8e584a405633dac89bf1f67eab8145971d2ddab2
* Hash support for std::wstring_view/u16string_view/u32string_viewGravatar Abseil Team2023-03-24
| | | | | PiperOrigin-RevId: 519200954 Change-Id: I349023cacab0ac4cbefb8505efd29a5eda1e9067
* type_traits_test: add better coverage of is_trivially_relocatable.Gravatar Abseil Team2023-03-24
| | | | | | | In preparation for changing its definition in an upcoming commit. PiperOrigin-RevId: 519141790 Change-Id: I49b608a575ad41e2f29d82489c1c09eec8c4d7e5
* Add a call to handle usage flags in case of unrecognized flagsGravatar Gennadiy Rozental2023-03-24
| | | | | PiperOrigin-RevId: 519090305 Change-Id: Ic97a36da33e1e0681765a913f3c54c3d818eebdc
* Make `ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS` work on MSVCGravatar Derek Mauro2023-03-23
| | | | | | | | | | | | https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/#c20-no_unique_address MSVC disables [[no_unique_address]] by default because of ABI compatibility. Since Abseil does not claim ABI compatibility in mixed-mode builds, we can offer it unconditionally. Fixes #1418 PiperOrigin-RevId: 518894036 Change-Id: If7653e65703b335783f11d296de7e32fc35d4fc6
* Import of CCTZ from GitHub.Gravatar Abseil Team2023-03-23
| | | | | PiperOrigin-RevId: 518850294 Change-Id: I3e9dcce5de2ae878d0992f05c0f39ccaf10a1ac5
* Internal Code ChangeGravatar Abseil Team2023-03-23
| | | | | PiperOrigin-RevId: 518835147 Change-Id: I86d8a49563cb5f74461a57e2b6dceac539749c86
* Add an implementation of Waiter that uses std::mutex/std::condition_variableGravatar Derek Mauro2023-03-21
| | | | | | | | | | | | | | | This implementation may at some point become the default on some platforms. Currently not all platforms have widespread support for both real absolute timeouts or real relative timeouts (here "real" means without converting to the other timeout type which is the only one supported by the underlying APIs). In this case we can defer to their standard library to implement correct support. This is not currently the default on any platform Note: The size of WaiterState had to increase to fit the new implementation PiperOrigin-RevId: 518266646 Change-Id: I7f246646a960d6e1b155f9de0bf2f681c5d3d245
* Change ParseAbseilFlagsOnly function to include handling of usage flags and ↵Gravatar Gennadiy Rozental2023-03-21
| | | | | | | exit on syntax errors. PiperOrigin-RevId: 518198160 Change-Id: Ib4fe53e0b0b371472b6b9473aeb84779953b6a38
* Synchronization: Refactor Waiter to allow us to write testsGravatar Derek Mauro2023-03-20
| | | | | | | | | | | | | Instead of being only able to test the platform Waiter implementation, this allows us to be able to test all Waiter implementations that build on a specific platform. A unittest is added that tests all implementations that work for the platform, and allows us to check that the expected one is being used by printing the name of the selected implementation. PiperOrigin-RevId: 518072415 Change-Id: Ie9e6fcd9d8283b4038e6f4e68a304d2adcc04b19
* Fix an implicit truncation warning under MSVC 32-bitGravatar Derek Mauro2023-03-20
| | | | | | | | | | Since the return value of `NumBits()` will always fit into `size_t`, use an explicit cast to silence the implicit conversion warning. Fixes #1384 PiperOrigin-RevId: 518041598 Change-Id: If2f2456db4b27b78e9ea9e026dce610953bd5bfb
* Add missing #include <exception> for std::terminateGravatar Abseil Team2023-03-20
| | | | | | | | It was previously included transitively through some other header, but with recent libc++ versions that's no longer the case. PiperOrigin-RevId: 517969848 Change-Id: I83c5c1853ae27b64a53a75a0f2faead37a70c145
* Add `ABSL_UNREACHABLE()` to `ABSL_RAW_LOG` when severity is `FATAL`Gravatar Wiktor Garbacz2023-03-20
| | | | | | | Also makes `ABSL_INTERNAL_LOG(LEVEL(x), "oops")` not call unreachable (even when x == kFatal) for consistency. PiperOrigin-RevId: 517894304 Change-Id: I798b1032d126330ace1e2b48edd8fc547a2ad2f8
* Increase the timeout of Windows for the kernel timeout tests.Gravatar Tom Rybka2023-03-16
| | | | | | | Windows tests often run in Emulation, and even with KVM we can still timeout. PiperOrigin-RevId: 517192968 Change-Id: I3b4e435f8ac8ad1e7eab6f043c051fa75efed64b
* Define ABSL_HAVE_DATAFLOW_SANITIZERGravatar Dave MacLachlan2023-03-16
| | | | | PiperOrigin-RevId: 517142676 Change-Id: If50a1bf5f92da166d6b4923110ec8b25446b6b11
* Be more consistent in the documentation and variable declarations for base64 ↵Gravatar Abseil Team2023-03-16
| | | | | | | | | | | escaping vs unescaping: * Move table documenting escaping conversions to be next to the internal escaping code that implements it. Mention it from the internal _un_escaping code (which reverses it) too. * Centralize the two arrays which map from normal chars to escaped chars (k(WebSafe)Base64Chars), and make bidirectional documentation links between them and their reverse (unescaping) maps (kUn(WebSafe)Base64). * Remove redundant list of escaping/unescaping methods in the public escaping.cc. PiperOrigin-RevId: 517142667 Change-Id: I627e59a196ef855e5bf61ef7f4b509920e8d7acd
* Enhance documentation about absl::Duration integer division, whichGravatar Abseil Team2023-03-15
| | | | | | | truncates, and floating-point multiplication/division, which rounds. PiperOrigin-RevId: 517016481 Change-Id: I3b0c357ea7236f2c0231df5e6b47c742c3f40047
* Add StrContainsIgnoreCase() to strings/match.h; all the other case-sensitive ↵Gravatar Greg Falcon2023-03-15
| | | | | | | methods in this file have corresponding case-insensitive ones. PiperOrigin-RevId: 516933773 Change-Id: Iaec41afd923b10bc493ad864c0ecfe85a1fe2db8
* Remove unreleased iterator library from README.mdGravatar Derek Mauro2023-03-15
| | | | | | | #1414 PiperOrigin-RevId: 516896705 Change-Id: Icd4ce24467ef9830ebbc68189addebb2ed1e95d4
* Workaround for MSVC warning that designated initializers are a C++20 featureGravatar Derek Mauro2023-03-15
| | | | | | | | | | | | https://google.github.io/styleguide/cppguide.html#Designated_initializers recommends using designated initializers as does https://abseil.io/tips/172, but apparently they are a non-standard extension prior to C++20. For maximum compatibility, avoid using them here. Fixes #1413 PiperOrigin-RevId: 516892890 Change-Id: Id7b7857891e39eb52132c3edf70e5bf4973755af
* Avoid uninitialized value in call_once implementation.Gravatar Henner Zeller2023-03-15
| | | | | | | | | | | | | There is a path in which the guard_result_ member is not initialized; this is benign as the code makes sure that it only accesses an initialized state. Static analysis tools (such as clang-tidy) might not see that however, so to make them happy, initialize that value. PiperOrigin-RevId: 516876319 Change-Id: I1bd2e97ad9e1daaa1397f306df993de13f7e684e
* Synchronization: Add support for true relative timeouts usingGravatar Derek Mauro2023-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | monotonic clocks on Linux when the implementation uses futexes After this change, when synchronization methods that wait are passed an absl::Duration to limit the wait time, these methods will wait for that interval, even if the system clock is changed (subject to any limitations with how CLOCK_MONOTONIC keeps track of time). In other words, an observer measuring the time with a stop watch will now see the correct interval, even if the system clock is changed. Previously, the duration was added to the current time, and methods would wait until that time was reached on the possibly changed realtime system clock. The behavior of the synchronization methods that take an absl::Time is unchanged. These methods always wait until the absolute point in time is reached and respect changes to the system clock. In other words, an observer will always see the timeout occur when a wall clock reaches that time, even if the clock is manipulated externally. Note: ABSL_PREDICT_FALSE was removed from the error case in Futex as timeouts are handled by this case, and timeouts are part of normal operation. PiperOrigin-RevId: 516534869 Change-Id: Ib70b83e4be3f9e3f1727646975a21a1d30acb242
* Correct semantic and documentation for the ReportUnrecognizedFlags interfaceGravatar Gennadiy Rozental2023-03-13
| | | | | PiperOrigin-RevId: 516411395 Change-Id: I442fc9435bd7a829802c325e2e4106aa6775c263
* Support AbslStringify in absl::Time and absl::Duration.Gravatar Abseil Team2023-03-13
| | | | | PiperOrigin-RevId: 516363556 Change-Id: Iae5e781d46dc8a8c4242ab460b57b65271b93159
* Synchronization: Change KernelTimeout to always store absoluteGravatar Derek Mauro2023-03-13
| | | | | | | | | | timeouts, but when a relative timeout is provided, the timeout is an absolute timeout against a steady clock (when possible). This allows methods that return relative timeouts to automatically recompute the remaining duration, for instance, on suprious wakeups. PiperOrigin-RevId: 516304139 Change-Id: I7d739cb50dd749eba5dba7ac6c34d18dc53703ed
* Performance improvement for absl::AsciiStrToUpper() and absl::AsciiStrToLower()Gravatar Abseil Team2023-03-13
| | | | | PiperOrigin-RevId: 516275043 Change-Id: I906ef0d96dddf12e3738490bd26cb05753ec008c
* Add ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS helper.Gravatar Chris Kennelly2023-03-13
| | | | | PiperOrigin-RevId: 516245113 Change-Id: Idaef538c9392decbfdeb3ed3b3c109c795f92f4d
* [absl] Update documentation to reflect hash support for std::wstring, ↵Gravatar Lawrence Wolf-Sonkin2023-03-10
| | | | | | | std::u16string and std::u32stringstrings PiperOrigin-RevId: 515726337 Change-Id: I08e184ec1f7169835c034ac45a7e87293dc53078
* Rollback Mutex relative timeout support because of internal incompatibilityGravatar Abseil Team2023-03-09
| | | | | PiperOrigin-RevId: 515427893 Change-Id: I89e8756fcf400459b0226d14785c6511ad3e380b
* Improve readability of ::testing::ElementsAre and ::testing::Le in unit ↵Gravatar Abseil Team2023-03-09
| | | | | | | tests assertions. PiperOrigin-RevId: 515396682 Change-Id: I1b07d94611323569b199e1f4d03c7c49147c6bfb
* Add note about using `CurrentThreadIdentityIfPresent()` on darwin based ↵Gravatar Dave MacLachlan2023-03-09
| | | | | | | platforms. PiperOrigin-RevId: 515353041 Change-Id: I2c88022d50a3351f70d09a2d63020470889752d9
* Merge pull request #1395 from AtariDreams:constGravatar Copybara-Service2023-03-08
|\ | | | | | | | | PiperOrigin-RevId: 515105001 Change-Id: I4a8ce8291ef3df23108dd21d8adb6752cde92dd0
* | Introduce two new public APIs for parsing command line flags.Gravatar Gennadiy Rozental2023-03-08
| | | | | | | | | | | | | | | | | | | | | | ParseAbseilFlagsOnly To be used to parse Abseil Flags only and classify the rest of the arguments. ReportUnrecognizedFlags To be used to report unrecognized flags. PiperOrigin-RevId: 515082682 Change-Id: I73271b56cc512a5e78b5fcd035564b3672d62ca8
* | Synchronization: Add support for true relative timeouts usingGravatar Derek Mauro2023-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | monotonic clocks on Linux when the implementation uses futexes After this change, when synchronization methods that wait are passed an absl::Duration to limit the wait time, these methods will wait for that interval, even if the system clock is changed (subject to any limitations with how CLOCK_MONOTONIC keeps track of time). In other words, an observer measuring the time with a stop watch will now see the correct interval, even if the system clock is changed. Previously, the duration was added to the current time, and methods would wait until that time was reached on the possibly changed realtime system clock. The behavior of the synchronization methods that take an absl::Time is unchanged. These methods always wait until the absolute point in time is reached and respect changes to the system clock. In other words, an observer will always see the timeout occur when a wall clock reaches that time, even if the clock is manipulated externally. Note: ABSL_PREDICT_FALSE was removed from the error case in Futex as timeouts are handled by this case, and timeouts are part of normal operation. PiperOrigin-RevId: 515043788 Change-Id: I151127b588065bd1316273f36d7c946545c2c892
| * Use const and static for member functionsGravatar Rose2023-03-07
|/ | | | This shows that these are member functions that do not modify a class's data.
* Internal Code ChangeGravatar Abseil Team2023-03-06
| | | | | PiperOrigin-RevId: 514567673 Change-Id: I02721d424f01965a7a5e08c06487af358c853627
* Support lvalue references to incomplete types as `FunctionRef` parameters.Gravatar Abseil Team2023-03-06
| | | | | PiperOrigin-RevId: 514451518 Change-Id: Ic1391374c7bff08ba437ac0410631d1f701bb9ed
* CMake: Install TESTONLY libraries and their dependencies whenGravatar Derek Mauro2023-03-02
| | | | | | | | | they are built https://github.com/abseil/abseil-cpp/issues/1407 PiperOrigin-RevId: 513684529 Change-Id: Ie0a164eea32becfef8f8e4a112aee158fd93dd7e
* Use multiple empty generations so that we can detect when iterators from ↵Gravatar Evan Brown2023-03-02
| | | | | | | different empty hashtables are compared. PiperOrigin-RevId: 513568915 Change-Id: I3f387d0bae0e86749dff540e4fdd5037304ac975
* Change from `ABSL_DLL ABSL_CONST_INIT` to `ABSL_CONST_INIT ABSL_DLL`Gravatar Derek Mauro2023-03-01
| | | | | | | This avoids "error: an attribute list cannot appear here" PiperOrigin-RevId: 513430681 Change-Id: I0fd31771793ee4cb66149ef4ce3e3e064dfb260d