summaryrefslogtreecommitdiff
path: root/absl/base
Commit message (Collapse)AuthorAge
* Roll back 6f972e239f668fa29cab43d7968692cd285997a9Gravatar Abseil Team2024-06-22
| | | | | | | | `optimization.h` needs to be compatible with C. `#include <utility>` is C++-only. PiperOrigin-RevId: 645651894 Change-Id: I55ebc3369b05788346cd0ab684b50bdfc2345fd4
* PR #1692: Add missing `<utility>` includeGravatar Patrick O'Connell2024-06-22
| | | | | | | | | | | | | Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1692 `optimization.h` uses `std::unreachable()` if available but does not include `<utility>`, causing errors in `absl/strings/ascii.cc`. Merge bf912bb4e38341d6152ee145ec2be00251c42552 into 8a28a0c8732ba3bf0191fb6292fcad6e5948a047 Merging this change closes #1692 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1692 from poconn:optimization_missing_include bf912bb4e38341d6152ee145ec2be00251c42552 PiperOrigin-RevId: 645643983 Change-Id: I3966984afa81f2f6bce65dd872d326f0af114bfa
* Add `ABSL_NULLABILITY_COMPATIBLE` attribute.Gravatar Martin Brænne2024-06-17
| | | | | | | | | | | | | | | | This is a replacement for the `absl_nullability_compatible` tag. The attribute has the advantage that, unlike the tag, it can be applied to forward declarations. This does not yet change the implementation of the nullability annotations -- that will come in a followup patch. As the nullability annotations themselves have not been changed, the `absl_nullability_compatible` tag is currently still used to check whether the annotations can be applied to a given type; see also the comments in the code. PiperOrigin-RevId: 644238698 Change-Id: I5882606f82ce7a6dd98e83e6d920573437561b50
* Add the missing inline namespace to the nullability filesGravatar Derek Mauro2024-06-12
| | | | | PiperOrigin-RevId: 642621989 Change-Id: I95efa4bd9fe8fe3c449304706401374f851f0fbe
* Set ABSL_HAVE_THREAD_LOCAL to 1 on all platformsGravatar Derek Mauro2024-05-31
| | | | | | | | | | thread_local is supported on all supported platforms https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md ABSL_HAVE_THREAD_LOCAL should be considered deprecated at this point. PiperOrigin-RevId: 639029951 Change-Id: I6525766c428f897fa50148e5c6b5a0f3fff0d9be
* Add ABSL_INTERNAL_ATTRIBUTE_VIEW and ABSL_INTERNAL_ATTRIBUTE_OWNER ↵Gravatar Abseil Team2024-05-23
| | | | | | | | | | | | | attributes to Abseil. This will enable diagnoses similar to those enabled by ABSL_ATTRIBUTE_LIFETIME_BOUND. See the following links for details: https://reviews.llvm.org/D64448 https://lists.llvm.org/pipermail/cfe-dev/2018-November/060355.html PiperOrigin-RevId: 636650605 Change-Id: Iab3a768d57775863addcf0a7c773551ee8f424c6
* Remove Asylo from absl.Gravatar Abseil Team2024-05-21
| | | | | PiperOrigin-RevId: 635913776 Change-Id: I8c765caa918b1afee9f855cf3afbc6489d60735f
* Allow __cxa_demangle on MIPSGravatar Benjamin Barenblat2024-05-13
| | | | | | | | Both libstdc++ and libc++abi currently ship a __cxa_demangle on MIPS; there’s no reason to avoid using it. PiperOrigin-RevId: 633319823 Change-Id: I8d28a87f9998a62a25e0e149138395f8994e6fb5
* Apply ABSL_MUST_USE_RESULT to try lock functions.Gravatar Chris Kennelly2024-04-25
| | | | | PiperOrigin-RevId: 628091370 Change-Id: I2dd20b7f33ab99e78d63688832ab475a513aa3fd
* PR #1651: Implement ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING for ↵Gravatar Pavel P2024-04-18
| | | | | | | | | | | | | | MSVC compiler Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1651 Merge 6c02d45f193cb9d8e26f2f8e4db57cea384cefb2 into 9a61b00dde4031f17ed4fa4bdc0e0e9ad8859846 Merging this change closes #1651 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1651 from pps83:ms-pragma-warn 6c02d45f193cb9d8e26f2f8e4db57cea384cefb2 PiperOrigin-RevId: 626108518 Change-Id: Idb00aca9bafbca92b231bdff7ef8c220948f134c
* Revert integer-to-string conversion optimizations pending more thorough analysisGravatar Abseil Team2024-03-26
| | | | | PiperOrigin-RevId: 619261152 Change-Id: Id3409b326c52ace0fda42537e0b91dbb2d6a2287
* PR #1644: unscaledcycleclock: remove RISC-V supportGravatar aurel322024-03-22
| | | | | | | | | | | | | | | | | | | | | | Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1644 Starting with Linux 6.6 [1], RDCYCLE is a privileged instruction on RISC-V and can't be used directly from userland. There is a sysctl option to change that as a transition period, but it will eventually disappear. The RDTIME instruction is another less accurate alternative, however its frequency varies from board to board, and there is currently now way to get its frequency from userland [2]. Therefore this patch just removes the code for unscaledcycleclock on RISC-V. Without processor specific implementation, abseil relies on std::chrono::steady_clock::now().time_since_epoch() which is basically a wrapper around clock_gettime (CLOCK_MONOTONIC), which in turns use __vdso_clock_gettime(). On RISC-V this VDSO is just a wrapper around RDTIME correctly scaled to use nanoseconds units. This fixes the testsuite on riscv64, tested on a VisionFive 2 board. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc4c07c89aada16229084eeb93895c95b7eabaa3 [2] https://github.com/abseil/abseil-cpp/pull/1631 Merge 43356a2548cfde76e164d446cb69004b488c6a71 into 76f8011beabdaee872b5fde7546e02407b220cb1 Merging this change closes #1644 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1644 from aurel32:rv64-no-unscaledcycleclock 43356a2548cfde76e164d446cb69004b488c6a71 PiperOrigin-RevId: 618286262 Change-Id: Ie4120a727e7d0bb185df6e06ea145c780ebe6652
* Delete ABSL_ANNOTATE_MEMORY_IS_INITIALIZED under Thread SanitizerGravatar Abseil Team2024-03-19
| | | | | PiperOrigin-RevId: 617266753 Change-Id: I6cac7b4616001c8d435fb1786da81b746f2d14cb
* Add nodiscard to SpinLockHolder.Gravatar Chris Kennelly2024-03-13
| | | | | PiperOrigin-RevId: 615473765 Change-Id: I03c3c16a0e178fce8a572ce272b7e1fd806a38a7
* [absl] Mark `absl::NoDestructor` methods with `absl::Nonnull` as appropriateGravatar Lawrence Wolf-Sonkin2024-02-29
| | | | | | | | * It is stated in prose that the methods on `absl::NoDestructor` can never return a null pointer * Now this is annotated via nullability annotations as well PiperOrigin-RevId: 611619075 Change-Id: I078a5628430b7b221c009a5dcb849efe30409c28
* Fix typo in example code snippet.Gravatar Abseil Team2024-02-27
| | | | | PiperOrigin-RevId: 610672905 Change-Id: I8e4ae98bb6e6421540a3073e3e6cb7de60fd32a9
* Minor documentation updates.Gravatar Abseil Team2024-02-21
| | | | | PiperOrigin-RevId: 609064443 Change-Id: Ifaeb53ae2d50bcef1ef6f67e662173b59c3fb8a2
* Annotate that SpinLock should warn when unused.Gravatar Chris Kennelly2024-02-20
| | | | | | | This often indicates a bug from adding synchronization logic but not using it. PiperOrigin-RevId: 608600311 Change-Id: I48bc3ae18b1e9a00b5e2152f33b486cd6be324a1
* Add ABSL_ATTRIBUTE_WARN_UNUSED.Gravatar Chris Kennelly2024-02-12
| | | | | | | | | | This allows us to annotate nontrivial types that should be flagged as unused variables. Compilers otherwise ignore nontrivial variables as their constructors/destructors may be desired and intentional (for example, a scoped lock). PiperOrigin-RevId: 606266618 Change-Id: I64b5f6d32a3cec2f18e0aa9029905f5e836c11a9
* Add the ABSL_DEPRECATE_AND_INLINE() macroGravatar Derek Mauro2024-02-08
| | | | | | | | | This macro is used by a Google-internal service for automated refactoring. It is being released so that Google projects that use this service can also open-source their code that uses it. PiperOrigin-RevId: 605322286 Change-Id: I16babcc56c454e07461690a8bb58be5da72d283f
* Add ABSL_ATTRIBUTE_UNINITIALIZED macros for use with clang and GCC's ↵Gravatar Abseil Team2024-02-01
| | | | | | | `uninitialized` PiperOrigin-RevId: 603344396 Change-Id: I06721246bf205284843065687378c6d905cbf879
* Replace `testonly = 1` with `testonly = True` in abseil BUILD files.Gravatar Shahriar Rouf2024-01-31
| | | | | | | https://bazel.build/build/style-guide#other-conventions PiperOrigin-RevId: 603084345 Change-Id: Ibd7c9573d820f88059d12c46ff82d7d322d002ae
* Remove code pieces for no longer supported GCC versions.Gravatar Abseil Team2024-01-22
| | | | | | | The minimum supported version today is GCC 7 (`__GNUC__ >= 7`). PiperOrigin-RevId: 600475215 Change-Id: I1aa46384f1e75f268649a48dbe2b42f3475bb07f
* Disable ABSL_ATTRIBUTE_TRIVIAL_ABI in open-source buildsGravatar Derek Mauro2024-01-22
| | | | | | | | | Since compiler support for this attribute differs, if for example system libraries compiled with GCC are mixed with libraries compiled with Clang, types will have different ideas about their ABI. PiperOrigin-RevId: 600467146 Change-Id: I5729e54d34176d019a2dee9afc36ed9da1da10fa
* Move default case to statement outside switch block in log_severity.h.Gravatar Daniel Cheng2024-01-11
| | | | | | | | Some compilers warn if a switch block that already covers all enumeration values also has a default label. PiperOrigin-RevId: 597583941 Change-Id: Ib3eb08dca0a19105522c61e47944cfc75280c15e
* Optimize integer-to-string conversionsGravatar Abseil Team2024-01-04
| | | | | | | | | | | | | | | | | | | | | | The updated code is designed to: - Be branch-predictor-friendly - Be cache-friendly - Minimize the lengths of critical paths - Minimize slow operations (particularly multiplications) - Minimize binary/codegen bloat The most notable performance trick here is perhaps the precomputation & caching of the number of digits, so that we can reuse/exploit it when writing the output. This precomputation of the exact length enables 2 further performance benefits: - It makes `StrCat` and `StrAppend` zero-copy when only integers are passed, by avoiding intermediate `AlphaNum` entirely in those cases. If needed in the future, we can probably also make many other mixtures of non-integer types zero-copy as well. - It avoids over-reservation of the string buffer, allowing for more strings to fit inside SSO, which will likely have further performance benefits. There is also a side benefit of preventing `FastIntToBuffer` from writing beyond the end of the buffer, which has caused buffer overflows in the past. The new code continues to use & extend some of the existing core tricks (such as the division-by-100 trick), as those are already efficient. PiperOrigin-RevId: 595785531 Change-Id: Id6920e7e038fec10b2c45f213de75dc7e2cbddd1
* [absl] Rename `absl::internal::identity` to `absl::internal::type_identity`Gravatar Lawrence Wolf-Sonkin2023-12-28
| | | | | | | | * Also does this for `absl::internal::identity_t` which is now `absl::internal::type_identity_t` * This is clearer naming as this is a backfill of `std::type_identity` (the identity type), and not `std::identity` (the identity function) PiperOrigin-RevId: 594316002 Change-Id: I5fb8cf7e3d07c1bc736cbecd202e7d556b6ea33e
* Add compile-checks to ensure the parameter to ↵Gravatar Abseil Team2023-12-28
| | | | | | | | | absl::numbers_internal::FastIntToBuffer isn't provably insufficient This performance-sensitive API is internal, and should not be used directly. Nevertheless, some do use it, so it's worth trying to block incorrect uses where we can. PiperOrigin-RevId: 594289730 Change-Id: Ib5df39b450ef2ceda795082cde10ec2ba2642172
* Migrate static objects to NoDestructor in tests, testing libraries and ↵Gravatar Abseil Team2023-12-26
| | | | | | | benchmarks. PiperOrigin-RevId: 593918110 Change-Id: Ide100c69b10e28011af17c7f82bb10eea072cad4
* Release a few bits and pieces of DFATAL that were left behind: flag parsing ↵Gravatar Andy Getzendanner2023-12-21
| | | | | | | & some tests. PiperOrigin-RevId: 592918704 Change-Id: Iacef0e069c012a04960211c032454244822f9634
* Cleanup build file by removing an empty srcs listGravatar Derek Mauro2023-12-18
| | | | | PiperOrigin-RevId: 591928115 Change-Id: I55de0886d3ce2d58cc1c94a15ce0f3eefc5eeaaf
* Redirect `GetPageSize()` to C library `getpagesize()` on Hexagon DSP.Gravatar Abseil Team2023-12-13
| | | | | PiperOrigin-RevId: 590669848 Change-Id: Ibc703b0fbedede86ddaa9682049b7dcc2250fbfb
* Add nullability annotationsGravatar Dmitri Gribenko2023-12-11
| | | | | PiperOrigin-RevId: 589842893 Change-Id: I9657761d1f71c665582406f278c6605f6d382f6d
* Enable ABSL_HAVE_POSIX_WRITE for Hexagon DSP build.Gravatar Abseil Team2023-12-07
| | | | | PiperOrigin-RevId: 588893303 Change-Id: I3f9278f2f7f0bc4b8903a87cb4a740daf7349755
* Roll-forward: Honor ABSL_MIN_LOG_LEVEL in CHECK_XX, CHECK_STRXX, CHECK_OK, ↵Gravatar Andy Getzendanner2023-12-05
| | | | | | | | | | | and the QCHECK flavors of these. In particular, if ABSL_MIN_LOG_LEVEL exceeds kFatal, these should, upon failure, terminate the program without logging anything. The lack of logging should be visible to the optimizer so that it can strip string literals and stringified variable names from the object file. Making some edge cases work under Clang required rewriting NormalizeLogSeverity to help make constraints on its return value more obvious to the optimizer. PiperOrigin-RevId: 588181755 Change-Id: I95db3bae39f8dadb52a307ca3b80775db23de766
* Make `absl::{partial,weak,strong}_ordering` aliases for the `std::` orderingGravatar Marcin Kowalczyk2023-12-05
| | | | | | | | | | | | types when they are available. This makes them interchangeable in contexts known to be compiled as C++20. This also makes `absl::` ordering types compatible with `<=>`, allowing to unconditionally use `absl::` spelling for types but conditionally use `<=>` when available. PiperOrigin-RevId: 588085408 Change-Id: I1aa5247f0e31acbb838ee76829b7a13c74b0a94f
* Avoid #pragma intrinsic(_mm_prefetch) on Arm64EC (and other platformsGravatar Derek Mauro2023-11-28
| | | | | | | | | without SSE) Closes #1575 PiperOrigin-RevId: 586009018 Change-Id: Icc34c1201268303dde96bfbb067506b861754b3a
* Fix documentation on when SpinLock is async-signal-safeGravatar Abseil Team2023-11-14
| | | | | PiperOrigin-RevId: 582426024 Change-Id: Ic8650de4faff9688f4cb5529c1df9bc752878b5a
* Add absl::NoDestructor<T>Gravatar Derek Mauro2023-11-08
| | | | | | | | | absl::NoDestructor<T> wraps an existing type and is used for defining a static type that does not need to be destructed upon program exit. Instead, such an object survives during program exit, and can be safely accessed at any time after construction. PiperOrigin-RevId: 580566259 Change-Id: I2cbb4cd9f6b50b98a793acd2ef0a4befd541f17f
* Add a new microbenchmark for spinlock TryLock and codegen functions.Gravatar Abseil Team2023-11-06
| | | | | PiperOrigin-RevId: 579852413 Change-Id: I1eddd70a4bee974e3a5109109ddfc4b4fd8f421e
* Prefer builtin to inline assembly when built with -mprfchw.Gravatar Chris Kennelly2023-10-26
| | | | | PiperOrigin-RevId: 576884571 Change-Id: I7bfe68e5aedd8563f8e6dbdb5d7cc66e9af22567
* PR #1553: Adapt to syscall(2) removal in OpenBSDGravatar Theo Buehler2023-10-25
| | | | | | | | | | | | | | | | | | | Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1553 OpenBSD will remove its generic syscall(2) interface, so setting the ABSL_HAVE_SYSCALL_WRITE define will result in a linking failure soon. Make direct use of the write(2) syscall instead. OpenBSD's libc does not do any buffering for write, so there is no change of behavior. A [variant of this patch][1] has been in use since early this year in OpenBSD's ports. There's no need to set ABSL_LOW_LEVEL_WRITE_SUPPORTED since that's already done a few lines up. [1]: https://github.com/openbsd/ports/commit/5f9e56cd982c1f1fa5af867e56355091e1817786 Merge 0dcc88a3cdab513c598587d85423135e85cec330 into b841db22f8d1d9cdbaacecf2e7c87ce270f8d96f Merging this change closes #1553 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1553 from botovq:openbsd-syscall 0dcc88a3cdab513c598587d85423135e85cec330 PiperOrigin-RevId: 576552197 Change-Id: I13466703ddc9d50edf87da5d0c291aad642af49a
* Add internal interface to determine if a SpinLock is cooperative.Gravatar Chris Kennelly2023-10-20
| | | | | | | | Some use cases of SpinLock need to verify that it is configured for non-cooperative scheduling. PiperOrigin-RevId: 575278400 Change-Id: Ic49f57a989a3f7f67e346a1ec545f4cd5b94f849
* Optimize prefetch codegen.Gravatar Dmitry Vyukov2023-10-18
| | | | | | | | | | | | | | | | | | | | | | | | Currently we use "r" constraint to pass prefetched address. This forces the compiler to actually put it into a register. As the result some uses look as: 16bfb7c: 48 01 cf add %rcx,%rdi 16bfb7f: 0f 0d 0f prefetchw (%rdi) -- 16bfccf: 48 83 c1 60 add $0x60,%rcx 16bfcd3: 0f 0d 09 prefetchw (%rcx) Use "m" constraint instead. It's more relaxed and requires to just materialize the address in some form using whatever addressing modes the target supports (e.g. x86 off(base, index, scale)). With the change the same code becomes: 16bfb7c: 0f 0d 0c 39 prefetchw (%rcx,%rdi,1) -- 16bfccf: 0f 0d 49 60 prefetchw 0x60(%rcx) PiperOrigin-RevId: 574723975 Change-Id: Id0c8645f8c702d1842685343901da321f6513156
* Bazel: Enable the header_modules featureGravatar Derek Mauro2023-10-11
| | | | | PiperOrigin-RevId: 572575394 Change-Id: Ic1c5ac2423b1634e50c43bad6daa14e82a8f3e2c
* Bazel: Support layering_check and parse_headersGravatar Derek Mauro2023-10-10
| | | | | | | | | | | | | The layering_check feature ensures that rules that include a header explicitly depend on a rule that exports that header. Compiler support is required, and currently only Clang 16+ supports diagnoses layering_check failures. The parse_headers feature ensures headers are self-contained by compiling them with -fsyntax-only on supported compilers. PiperOrigin-RevId: 572350144 Change-Id: I37297f761566d686d9dd58d318979d688b7e36d1
* ABSL_INTERNAL_HAS_CXA_DEMANGLE: Check __GNUC__ is defined.Gravatar Abseil Team2023-10-09
| | | | | PiperOrigin-RevId: 571929102 Change-Id: I8fb907d047a4ff3bb42e7c7f99454fa687b8f1c9
* Re-submit with a fix for platforms without RTTI.Gravatar Abseil Team2023-10-02
| | | | | | | We test for `ABSL_INTERNAL_HAS_RTTI` in `absl::container_internal::TypeName` before calling `typeid`. PiperOrigin-RevId: 570101013 Change-Id: I1f2f9b2f475a6beae50d0b88718b17b296311155
* No public descriptionGravatar Abseil Team2023-09-27
| | | | | PiperOrigin-RevId: 568845530 Change-Id: I8987053041423f1e8b122372f63b0a84e05eb594
* Add an internal wrapper for `abi::__cxa_demangle()`.Gravatar Abseil Team2023-09-26
| | | | | PiperOrigin-RevId: 568665135 Change-Id: I42ec9bc6cfe923777f7b60ea032c7b64428493c9