aboutsummaryrefslogtreecommitdiff
path: root/absl/base/internal
Commit message (Collapse)AuthorAgeFilesLines
* Add missing include for Windows ASAN configuration in poison.ccAbseil Team2024-07-181-1/+3
| | | | | | | GetPageSize requires windows include regardless of presence of ASAN or MSAN PiperOrigin-RevId: 653705885 Change-Id: I4c7eec09db6c1a6168dd249cf584f1774d6cead2
* Roll forward poisoned pointer API and fix portability issues.Evan Brown2024-07-103-0/+182
| | | | | | | Also, return the middle of the poisoned block. PiperOrigin-RevId: 651119057 Change-Id: Iae0fc3dcb40e32cd449f469d9b8d62c37f3773f4
* Rollback new poisoned pointer APIDerek Mauro2024-07-013-154/+0
| | | | | | | | | This breaks Chromium due to global constructor and incorrectly assumes page size. https://github.com/abseil/abseil-cpp/pull/1697 PiperOrigin-RevId: 648377066 Change-Id: I19f8b2655971a0c314091e26e62e10a5a9c46e94
* Remove erroneous preprocessor branch on SGX_SIM.Evan Brown2024-06-251-1/+1
| | | | | PiperOrigin-RevId: 646614152 Change-Id: Iee853bdc6f753d758c850a529a6adb05d0d0b1a7
* Add an internal API to get a poisoned pointer.Evan Brown2024-06-243-0/+154
| | | | | | | The motivation is to make destroyed/moved-from objects cause crashes when they are accessed. PiperOrigin-RevId: 646229564 Change-Id: I68d9c189b542df0933af08f5ad63dc1f5764d856
* Add the missing inline namespace to the nullability filesDerek Mauro2024-06-121-1/+3
| | | | | PiperOrigin-RevId: 642621989 Change-Id: I95efa4bd9fe8fe3c449304706401374f851f0fbe
* Apply ABSL_MUST_USE_RESULT to try lock functions.Chris Kennelly2024-04-251-2/+3
| | | | | PiperOrigin-RevId: 628091370 Change-Id: I2dd20b7f33ab99e78d63688832ab475a513aa3fd
* PR #1644: unscaledcycleclock: remove RISC-V supportaurel322024-03-222-16/+4
| | | | | | | | | | | | | | | | | | | | | | 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
* Add nodiscard to SpinLockHolder.Chris Kennelly2024-03-131-0/+9
| | | | | PiperOrigin-RevId: 615473765 Change-Id: I03c3c16a0e178fce8a572ce272b7e1fd806a38a7
* Annotate that SpinLock should warn when unused.Chris Kennelly2024-02-201-1/+1
| | | | | | | This often indicates a bug from adding synchronization logic but not using it. PiperOrigin-RevId: 608600311 Change-Id: I48bc3ae18b1e9a00b5e2152f33b486cd6be324a1
* [absl] Rename `absl::internal::identity` to `absl::internal::type_identity`Lawrence Wolf-Sonkin2023-12-282-20/+23
| | | | | | | | * 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
* Migrate static objects to NoDestructor in tests, testing libraries and ↵Abseil Team2023-12-261-3/+6
| | | | | | | benchmarks. PiperOrigin-RevId: 593918110 Change-Id: Ide100c69b10e28011af17c7f82bb10eea072cad4
* Release a few bits and pieces of DFATAL that were left behind: flag parsing ↵Andy Getzendanner2023-12-211-0/+2
| | | | | | | & some tests. PiperOrigin-RevId: 592918704 Change-Id: Iacef0e069c012a04960211c032454244822f9634
* Redirect `GetPageSize()` to C library `getpagesize()` on Hexagon DSP.Abseil Team2023-12-131-1/+1
| | | | | PiperOrigin-RevId: 590669848 Change-Id: Ibc703b0fbedede86ddaa9682049b7dcc2250fbfb
* Add nullability annotationsDmitri Gribenko2023-12-112-18/+26
| | | | | PiperOrigin-RevId: 589842893 Change-Id: I9657761d1f71c665582406f278c6605f6d382f6d
* Enable ABSL_HAVE_POSIX_WRITE for Hexagon DSP build.Abseil Team2023-12-071-2/+3
| | | | | PiperOrigin-RevId: 588893303 Change-Id: I3f9278f2f7f0bc4b8903a87cb4a740daf7349755
* Fix documentation on when SpinLock is async-signal-safeAbseil Team2023-11-141-4/+4
| | | | | PiperOrigin-RevId: 582426024 Change-Id: Ic8650de4faff9688f4cb5529c1df9bc752878b5a
* Add a new microbenchmark for spinlock TryLock and codegen functions.Abseil Team2023-11-061-1/+26
| | | | | PiperOrigin-RevId: 579852413 Change-Id: I1eddd70a4bee974e3a5109109ddfc4b4fd8f421e
* PR #1553: Adapt to syscall(2) removal in OpenBSDTheo Buehler2023-10-251-9/+6
| | | | | | | | | | | | | | | | | | | 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.Chris Kennelly2023-10-201-0/+13
| | | | | | | | Some use cases of SpinLock need to verify that it is configured for non-cooperative scheduling. PiperOrigin-RevId: 575278400 Change-Id: Ic49f57a989a3f7f67e346a1ec545f4cd5b94f849
* Fix GetTID() on FreeBSDDerek Mauro2023-09-071-1/+5
| | | | | | | | | | | | | https://github.com/abseil/abseil-cpp/issues/1518#issuecomment-1709098904 pointed out that the previous untested fix doesn't work because pthread_getthreadid_np() has a different signature on Darwin. Follow up to https://github.com/abseil/abseil-cpp/commit/b9707b7d7845f9710ae6d5906827b833fdcc2754 Fixes #1518 PiperOrigin-RevId: 563432451 Change-Id: Id0a9212e9c4413fa520a42934efaed2a06ca5dbc
* Use native methods to implement absl::base_internal::GetPID() onDerek Mauro2023-09-061-1/+17
| | | | | | | | | | | | | | | | FreeBSD, NetBSD, and OpenBSD https://man.freebsd.org/cgi/man.cgi?query=pthread_getthreadid_np https://man.netbsd.org/_lwp_self.2 https://man.openbsd.org/getthrid.2 This fixes a build break caused by https://github.com/abseil/abseil-cpp/commit/88cc63ef739d83277b492e881be72e9069fcb1fe Fixes #1518 PiperOrigin-RevId: 563200172 Change-Id: Ifd1b65c84e3631075248bc2e01b8f047dc72d201
* Delete //absl/base/internal/prefetch.hDerek Mauro2023-08-312-180/+0
| | | | | | | Public functions are now available in //absl/base/prefetch.h PiperOrigin-RevId: 561649346 Change-Id: Ic377ad5f21c9a44ea1f213dec17f5cf97795ebde
* Remove the legacy thread annotation spellingsDerek Mauro2023-08-281-280/+0
| | | | | | | | | | | | | | | | The legacy thread annotations were spellings that were not prefixed with ABSL_ and caused conflicts with other libraries. These spellings have been removed by default for a while, but could have been added back with the temporary compile flag -DABSL_LEGACY_THREAD_ANNOTATIONS. This change completely removes the legacy spellings. If you were relying on the legacy spellings, the fix is straightforward. Simply add the ABSL_ prefix. For example, GUARDED_BY() becomes ABSL_GUARDED_BY(). PiperOrigin-RevId: 560874026 Change-Id: Id072e67435472220ea4f43ccbf267028c13feba7
* PR #1509: Allow building when targeting WASIAnuraag Agrawal2023-08-151-4/+10
| | | | | | | | | | | | | Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1509 WASI is similar to emscripten, providing a syscall layer to WebAssembly focused on server side applications. There are some config knobs that are in place to allow building the repo for emscripten which also need to support wasi (as built with LLVM). Aside from that, there are still some features it supports less than escripten, for example related to signals, causing the build to be even more limited for it. Merge ec9fa081609687035005dfdafd312754f31c3fbb into 861e53c8f075c8c4d67bd4c82217c57239fc97cf Merging this change closes #1509 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1509 from anuraaga:wasi-sdk-build ec9fa081609687035005dfdafd312754f31c3fbb PiperOrigin-RevId: 557166498 Change-Id: Ic51149d8b092fd888c9a5c383275257fc8ff4232
* PR #1500: Define MAP_ANONYMOUS if not definedRyan Schmidt2023-08-011-38/+33
| | | | | | | | | | | | Included are additional automated edits by clang-format on import. Merge d74896699faacc4a1667603e52e72cbdc8006cf6 into 22091f4c0d6626b3ef40446ce3d4ccab19425ca3 Merging this change closes #1500 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1500 from ryandesign:MAP_ANONYMOUS d74896699faacc4a1667603e52e72cbdc8006cf6 PiperOrigin-RevId: 552922776 Change-Id: I96a0395cb5e7156d7c7a889491c5d0b4cf755819
* Add Support for mmap on Qualcomm Hexagon DSP targets.Abseil Team2023-07-172-2/+3
| | | | | PiperOrigin-RevId: 548709037 Change-Id: I6eb03553299265660aa0abc180ae0f197a416ba4
* Use new emscripten_errn to avoid copying strings.Abseil Team2023-07-131-11/+16
| | | | | PiperOrigin-RevId: 547895328 Change-Id: If5da952604415fa6ed2402052f80add6c4b7dfb3
* Rename `absl::NonNull` to `absl::Nonnull`.Abseil Team2023-07-061-3/+3
| | | | | | | The current spelling is inconsistent with standard casing rules: "nonnull" is a single word, not two. PiperOrigin-RevId: 546034114 Change-Id: I04e5a204f4a74ebaa76031dd0b0874ca9cfa902c
* Rolls back use of emscripten_errn as some implementations may not be compatible.Abseil Team2023-06-301-15/+11
| | | | | PiperOrigin-RevId: 544677169 Change-Id: I98874c5c8d1c9a057958b63e2b3c4fdd5daccd39
* Use new emscripten_errn to avoid copying strings.Abseil Team2023-06-291-11/+15
| | | | | PiperOrigin-RevId: 544461113 Change-Id: Iafbd6daf2d03ae18a49ea449315ee7cd6a0e615e
* Support Qualcomm Hexagon DSP targets.Abseil Team2023-06-292-2/+8
| | | | | PiperOrigin-RevId: 544438364 Change-Id: I22d461f2d0aa8638a0e640eebecdc7e5e2b49ea3
* absl: reformat Mutex-related filesAbseil Team2023-06-202-16/+14
| | | | | | | | | | | Reformat Mutex-related files so that incremental formatting changes don't distract during review of logical changes. These files are subtle and any unnecessary diffs make reviews harder. No changes besides running clang-format. PiperOrigin-RevId: 541981737 Change-Id: I41cccb7a97158c78d17adaff6fe553c2c9c2b9ed
* Add Nullability annotations to Abseil.Abseil Team2023-06-201-0/+106
| | | | | PiperOrigin-RevId: 541915097 Change-Id: I7ebfbafc36db38b59b30ab5b312cd7e22082a805
* Rename AsyncSignalSafeWriteToStderr to AsyncSignalSafeWriteError.Abseil Team2023-06-152-3/+3
| | | | | | | It no longer strictly writes to stderr, since Emscripten/WebAssembly now use _emscripten_err which might be replaced by something that is not the same as stderr by the host. PiperOrigin-RevId: 540655336 Change-Id: Icc2a430a0db53a1282ef5558e9f3648db67e972c
* For web assembly, implement raw logging as direct JS console logging.Abseil Team2023-06-141-1/+25
| | | | | | | This bypasses the need for filesystem APIs just for stderr access. PiperOrigin-RevId: 540367155 Change-Id: Ib91dadac28cb5c8e571407b5dfa60c3e65539c95
* DirectMmap: Use off_t instead of off64_t for the offset parameterDerek Mauro2023-06-121-2/+2
| | | | | | | | | | | | | | | | off_t is best for portability. Its size varies with the platform. off64_t is non-standard, but is present in glibc and some BSDs. It also matches the signature specified in the manual. https://man7.org/linux/man-pages/man2/mmap.2.html This is a re-spin of #1349, but correctly casts the type to the type expected by the kernel for mmap2. https://man7.org/linux/man-pages/man2/mmap2.2.html Fixes #1473 PiperOrigin-RevId: 539656313 Change-Id: I7a30dd9d3eb6af03a99da0d93d721a86f6521b25
* Implement GetTID for NACL platform.Abseil Team2023-06-091-0/+9
| | | | | | | in NACL pthread_self() returns a pointer that isn't directly convertible to arithmetic type. PiperOrigin-RevId: 539023020 Change-Id: I3745ec5565f3a99ccb1d9df12c27a80e57ca4755
* Merge pull request #1458 from juergbi:aixCopybara-Service2023-06-071-3/+2
|\ | | | | | | | | PiperOrigin-RevId: 538488164 Change-Id: I680dcbc2f27dca3beba416b3cd0a55943751cf4c
| * absl/base: Fix build on AIXJürg Billeter2023-05-241-2/+1
| | | | | | | | | | | | | | | | The AIX assembler doesn't support numeric labels. Use a relative jump instead to fix Assembler: /tmp/ccw16WCt.s: line 25: Error In Syntax
* | Switch from perror to ABSL_INTERNAL_LOG.Abseil Team2023-05-311-2/+3
| | | | | | | | | | | | | | Motivation is for WebAssembly to avoid perror which in turn requires file system emulation. PiperOrigin-RevId: 536737294 Change-Id: I5177064c9451fb630ec5e9d0c0a0679fabd98afa
* | Implement a better GetTID on Apple platforms, and a better fallback too.Andy Getzendanner2023-05-251-71/+13
| | | | | | | | | | | | | | The fallback isn't totally portable, even within POSIX, but we can special case any future platforms where it's not just like this change does for Apple. PiperOrigin-RevId: 535324103 Change-Id: Ib628925c4946b6c112373678fe37e9bb44259090
* | Note that AsyncSignalSafeWriteToStderr preserves errno, and inline one use ↵Andy Getzendanner2023-05-251-1/+1
|/ | | | | | | of it into a lambda. PiperOrigin-RevId: 535245982 Change-Id: I816f60c8b6476536df6836500f01c9a3ad88ddd4
* Fix some spelling mistakesVertexwahn2023-04-242-2/+2
|
* Add ABSL_RAW_DLOG and ABSL_RAW_DCHECK macrosMartijn Vels2023-04-181-0/+14
| | | | | PiperOrigin-RevId: 525241200 Change-Id: I8d1536cb813da8b80a978340343b0243a49928f7
* Name anonymous memory allocations on Linux.Abseil Team2023-04-121-0/+16
| | | | | | | | | | | | | | | | | | | Use Linux's prctl(PR_SET_VMA) system call to name memory arenas being allocated using mmap(MAP_ANONYMOUS). This change allows Abseil's memory arena(s) to be distinguished from other uses of anonymous memory within a process, which in turn helps investigations into the memory usage of applications. The change adds a new prctl() system call to the code paths that call mmap(). This is not expected to add significant overhead to applications. The call to prctl(PR_SET_VMA, ...) can fail if the Linux kernel in use was not configured with the CONFIG_ANON_VMA_NAME kernel option. This should be OK since the naming memory regions is primarily a debugging aid. PiperOrigin-RevId: 523687348 Change-Id: Ie404e5eeef0a6da53330b3a56149c4f3bc6bf5c7
* Add an implementation of Waiter that uses std::mutex/std::condition_variableDerek Mauro2023-03-211-1/+1
| | | | | | | | | | | | | | | 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
* Add `ABSL_UNREACHABLE()` to `ABSL_RAW_LOG` when severity is `FATAL`Wiktor Garbacz2023-03-201-2/+8
| | | | | | | Also makes `ABSL_INTERNAL_LOG(LEVEL(x), "oops")` not call unreachable (even when x == kFatal) for consistency. PiperOrigin-RevId: 517894304 Change-Id: I798b1032d126330ace1e2b48edd8fc547a2ad2f8
* Add note about using `CurrentThreadIdentityIfPresent()` on darwin based ↵Dave MacLachlan2023-03-091-1/+4
| | | | | | | platforms. PiperOrigin-RevId: 515353041 Change-Id: I2c88022d50a3351f70d09a2d63020470889752d9
* Delete the `Throw()` function from `absl::base_internal`.Devin Jeanpierre2023-03-011-32/+23
| | | | | | | This was originally added in order to centralize the ifdefs, in cl/164484905. However, cl/337142938 undid this aspect of the change, because it broke on Android. What is left is vestigial: `Throw()` can be deleted at no loss, with a warning that should discourage us from ever reintroducing it. PiperOrigin-RevId: 513391041 Change-Id: I1608a2007eb26ee95df07f3b4b1672c034743832