summaryrefslogtreecommitdiff
path: root/absl/base/internal
Commit message (Collapse)AuthorAge
* absl: reformat Mutex-related filesGravatar Abseil Team2023-06-20
| | | | | | | | | | | 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.Gravatar Abseil Team2023-06-20
| | | | | PiperOrigin-RevId: 541915097 Change-Id: I7ebfbafc36db38b59b30ab5b312cd7e22082a805
* Rename AsyncSignalSafeWriteToStderr to AsyncSignalSafeWriteError.Gravatar Abseil Team2023-06-15
| | | | | | | 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.Gravatar Abseil Team2023-06-14
| | | | | | | 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 parameterGravatar Derek Mauro2023-06-12
| | | | | | | | | | | | | | | | 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.Gravatar Abseil Team2023-06-09
| | | | | | | 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:aixGravatar Copybara-Service2023-06-07
|\ | | | | | | | | PiperOrigin-RevId: 538488164 Change-Id: I680dcbc2f27dca3beba416b3cd0a55943751cf4c
* | Switch from perror to ABSL_INTERNAL_LOG.Gravatar Abseil Team2023-05-31
| | | | | | | | | | | | | | 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.Gravatar Andy Getzendanner2023-05-25
| | | | | | | | | | | | | | 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 ↵Gravatar Andy Getzendanner2023-05-25
| | | | | | | | | | | | | | of it into a lambda. PiperOrigin-RevId: 535245982 Change-Id: I816f60c8b6476536df6836500f01c9a3ad88ddd4
| * absl/base: Fix build on AIXGravatar Jürg Billeter2023-05-24
|/ | | | | | | | The AIX assembler doesn't support numeric labels. Use a relative jump instead to fix Assembler: /tmp/ccw16WCt.s: line 25: Error In Syntax
* Fix some spelling mistakesGravatar Vertexwahn2023-04-24
|
* Add ABSL_RAW_DLOG and ABSL_RAW_DCHECK macrosGravatar Martijn Vels2023-04-18
| | | | | PiperOrigin-RevId: 525241200 Change-Id: I8d1536cb813da8b80a978340343b0243a49928f7
* Name anonymous memory allocations on Linux.Gravatar Abseil Team2023-04-12
| | | | | | | | | | | | | | | | | | | 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_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
* 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
* Add note about using `CurrentThreadIdentityIfPresent()` on darwin based ↵Gravatar Dave MacLachlan2023-03-09
| | | | | | | platforms. PiperOrigin-RevId: 515353041 Change-Id: I2c88022d50a3351f70d09a2d63020470889752d9
* Delete the `Throw()` function from `absl::base_internal`.Gravatar Devin Jeanpierre2023-03-01
| | | | | | | 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
* Prefer C++ notation over CGravatar Rose2023-02-16
| | | | nullptr instead of 0 and nothing instead of void for function arguments is preferred.
* Replace absl::base_internal::Prefetch* calls with absl::Prefetch* callsGravatar Martijn Vels2023-01-27
| | | | | PiperOrigin-RevId: 505184961 Change-Id: I64482558a76abda6896bec4b2d323833b6cd7edf
* Rollback of PR #1349: direct_mmap: Use off_t on linux...Gravatar Abseil Team2023-01-10
| | | | | PiperOrigin-RevId: 501014555 Change-Id: Ie204d307a4e537935a04c0f23bb13532e3c84bc8
* Merge pull request #1349 from kraj:remove-off64_tGravatar Copybara-Service2023-01-06
|\ | | | | | | | | PiperOrigin-RevId: 500300819 Change-Id: Iacff97071d158843d687c811b0d78d4ddeba9039
| * direct_mmap: Use off_t on linuxGravatar Khem Raj2022-12-28
|/ | | | | | | | | | off64_t is not provided without defining _LARGEFILE64_SOURCE on musl this define is not defined automatically like glibc where it gets defined when _GNU_SOURCE is defined. Using off_t makes it portable across musl/glibc and for using 64bit off_t on glibc 32bit systems -D_FILE_OFFSET_BITS=64 can be defined during build via CXXFLAGS Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Add a comment about the layout of the fields in ThreadIdentityGravatar Abseil Team2022-12-28
| | | | | PiperOrigin-RevId: 498179140 Change-Id: Ie18b68e6313817b4f41fec6b10dd878436431730
* Replace ABSL_INTERNAL_UNREACHABLE with ABSL_UNREACHABLE()Gravatar Derek Mauro2022-12-22
| | | | | PiperOrigin-RevId: 497197704 Change-Id: I3865a874e04f6f55a1ab374b03451535a86bc5a3
* Removes the legacy spellings of the thread annotation macros/functionsGravatar Derek Mauro2022-10-03
| | | | | | | | | | | | | | | | by default. The compatibility macro `ABSL_LEGACY_THREAD_ANNOTATIONS` can be defined on the compile command-line to temporarily restore these spellings. All of the thread annotation macros are available under ABSL_ prefixed spellings in `absl/base/thread_annotations.h`. The compatibility macro and the legacy spellings will be removed in the future. See https://github.com/google/fuzztest/issues/41 PiperOrigin-RevId: 478498273 Change-Id: I120ad6480d031642bf95a11bf72ab883d9161810
* `absl::base_internal::ReadLongFromFile` should use `O_CLOEXEC` and handle ↵Gravatar Abseil Team2022-09-28
| | | | | | | interrupts to `read` PiperOrigin-RevId: 477547252 Change-Id: Icc94290511b5071d15584d59dcd9cf6ad7319e2b
* Split configuration related to cycle clock into separate headersGravatar Abseil Team2022-09-26
| | | | | PiperOrigin-RevId: 477043101 Change-Id: I009ea39ad61e7e78cdac51afc57a8ad5b4d8aa2d
* Fix "unsafe narrowing" warnings in absl, 8/n.Gravatar Abseil Team2022-09-12
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .cc files in */internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 473868797 Change-Id: Ibe0b76e33f9e001d59862beaac54fb47bacd39b2
* Rollback of fix "unsafe narrowing" warnings in absl, 8/n.Gravatar Derek Mauro2022-09-01
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .cc files in */internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 471561809 Change-Id: I7abd6d83706f5ca135f1ce3458192a498a6280b9
* Fix "unsafe narrowing" warnings in absl, 8/n.Gravatar Abseil Team2022-09-01
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .cc files in */internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 471549854 Change-Id: Id685d0e4666212926f4e001b8ef4930b6a33a4cc
* Fixed header guards to match style guide conventions.Gravatar Abseil Team2022-08-31
| | | | | PiperOrigin-RevId: 471292183 Change-Id: Ic124d671dd3b0ae819f741885abb046cbf7e1add
* spinlock.h: Clean up includesGravatar Abseil Team2022-08-24
| | | | | | | | 1. Removes unused includes 2. Replaces <stdint.h> with <cstdint> PiperOrigin-RevId: 469705016 Change-Id: Ic32871be93d01436f5538c44321faad7bd2e4511
* Fix "unsafe narrowing" warnings in absl, 2/n.Gravatar Abseil Team2022-08-01
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .cc files in dirs a-h.) Bug: chromium:1292951 PiperOrigin-RevId: 464541951 Change-Id: If23b63ccea8e9b730159ff1c7288e9300a40b6bd
* Fix "unsafe narrowing" warnings in absl, 1/n.Gravatar Abseil Team2022-07-28
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .h and win32 .inc files.) Bug: chromium:1292951 PiperOrigin-RevId: 463835431 Change-Id: If8e5f7f651d5cd96035e23e4623bdb08a7fedabe
* Renamespace absl::raw_logging_internal to absl::raw_log_internal to match ↵Gravatar Andy Getzendanner2022-07-20
| | | | | | | (upcoming) non-raw logging namespace. PiperOrigin-RevId: 462213222 Change-Id: I3b9371097b368d55cc86b6106d6dec24ce122762
* PR #1197: absl/base/internal/direct_mmap.h: fix musl build on mipsGravatar Fabrice Fontaine2022-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1197 Fix the following musl build failure on mips: ``` In file included from /nvmedata/autobuild/instance-15/output-1/build/libabseil-cpp-20211102.0/absl/base/internal/low_level_alloc.cc:26: /nvmedata/autobuild/instance-15/output-1/build/libabseil-cpp-20211102.0/absl/base/internal/direct_mmap.h:49:10: fatal error: sgidefs.h: No such file or directory 49 | #include <sgidefs.h> | ^~~~~~~~~~~ ``` Fixes: - http://autobuild.buildroot.org/results/3fa027e602bacb22316fb5d9b233baa0b0f0e845 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Merge c9b5b5c5471213a871f7d6d1d2fc8f6899effbac into a184bab83ffcffc2aaac49a3900361158ab3890f Merging this change closes #1197 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1197 from ffontaine:master c9b5b5c5471213a871f7d6d1d2fc8f6899effbac PiperOrigin-RevId: 455467767 Change-Id: I1905f7d70e914288bc1524a52adce3476a779fd8
* absl/base/internal/invoke: Ignore bogus warnings on GCC >= 11Gravatar Dino Radakovic2022-06-16
| | | | | PiperOrigin-RevId: 455463553 Change-Id: Ifa6c238556339dd4e36715ac040ca048f2f84a9a
* absl/base/internal/invoke.h: Use ABSL_INTERNAL_CPLUSPLUS_LANG for language ↵Gravatar Dino Radakovic2022-06-09
| | | | | | | version guard PiperOrigin-RevId: 453970585 Change-Id: Iac23eb88ea676efc822f001020b1cc2c255dbbc1
* Fix C++17 constexpr storage deprecation warningsGravatar Derek Mauro2022-06-09
| | | | | | | | | | | | | | | | | | | This change introduces the symbol ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL to guard redundant declarations of static constexpr data members that are needed prior to C++17. This change also introduces the symbol ABSL_INTERNAL_CPLUSPLUS_LANG, which is supposed to be set to the same value as __cplusplus, except it uses _MSVC_LANG on MSVC so that the value is correct on MSVC. Neither of these new symbols should be used outside of Abseil. Fixes #1191 PiperOrigin-RevId: 453923908 Change-Id: I1316c52c19fa0c168b93cced0c817e4cb7c9c862
* Merge pull request #714 from kgotlinux:patch-2Gravatar Copybara-Service2022-06-02
|\ | | | | | | | | PiperOrigin-RevId: 452619005 Change-Id: I6c120f9e7bbabe3b00821adc441608ae9118bee6
* | Include proper #includes for POSIX thread identity implementation when using ↵Gravatar Andy Getzendanner2022-06-02
| | | | | | | | | | | | | | | | | | that implementation on MinGW. Fixes #1124 PiperOrigin-RevId: 452596638 Change-Id: Iab34b8e112dc050ffe346a418fa7b499983f0dcf
* | Stop using sleep timeouts for Linux futex-based SpinLockGravatar Derek Mauro2022-05-31
| | | | | | | | | | | | | | | | | | | | | | | | Timeouts were once necessary when the SpinLock Unlock used an atomic store and could therefore have a race and a missed wakeup, however, the Unlock path now uses an atomic exchange, so the missed wakeup cannot happen. Fixes #1179 PiperOrigin-RevId: 452047517 Change-Id: I844944879b51b7f7ddac148e063a376cddd0d05a
* | Add implementation of is_invocable_r to absl::base_internal for C++ < 17, ↵Gravatar Dino Radakovic2022-05-26
| | | | | | | | | | | | | | define it as alias of std::is_invocable_r when C++ >= 17 PiperOrigin-RevId: 451171660 Change-Id: I6dc0e40eabac72b82c4a19e292158e43118cb080
* | Don't default to the unscaled cycle clock on any Apple targets.Gravatar Tom Rybka2022-05-19
| | | | | | | | | | | | | | | | Previously was disabled on iPhone, but still enabled for macOS. The unscaled cycle clock does not work correctly when run on a VM. PiperOrigin-RevId: 449876559 Change-Id: I679ade90b43462e8d2794b1a2b32569d59029ed9
* | Use SSE instructions for prefetch when __builtin_prefetch is unavailableGravatar Derek Mauro2022-05-18
| | | | | | | | | | | | | | | | | | | | | | | | This notably gets prefetch working on MSVC Implementation note: https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-prefetchcacheline MSVC does have PreFetchCacheLine, but that would require including <windows.h> in a header PiperOrigin-RevId: 449602543 Change-Id: I5e6ca4b7c3d287779aa03c2fd348b41fb65c3680
* | Replace direct uses of __builtin_prefetch from SwissTable with the wrapper ↵Gravatar Greg Falcon2022-05-18
| | | | | | | | | | | | | | | | | | | | | | functions. Add a new (internal) feature test macro to detect whether the wrappers are no-ops on a given platform. Note that one-arg __builtin_prefetch(x) is equivalent to __builtin_prefetch(x, 0, 3), per `man BUILTIN_PREFETCH(3)` and gcc docs. PiperOrigin-RevId: 449508660 Change-Id: I144e750205eec0c956d8dd62bc72e10bdb87c4f7
* | Cast away an unused variable to play nice with -Wunused-but-set-variable.Gravatar Abseil Team2022-05-17
| | | | | | | | | | PiperOrigin-RevId: 449351955 Change-Id: Id30280107bb29f7d715327b99a2c954809513a48
* | raw_logging: Extract the inlined no-hook-registered behavior for ↵Gravatar Andy Getzendanner2022-05-17
| | | | | | | | | | | | | | LogPrefixHook to a default implementation. PiperOrigin-RevId: 449306617 Change-Id: Ia3e87d2edcae7e9874998f21a0e2ff245e48fd96
* | raw_logging: Document that AbortHook's buffers live for as long as the ↵Gravatar Andy Getzendanner2022-05-05
| | | | | | | | | | | | | | process remains alive. PiperOrigin-RevId: 446725910 Change-Id: I291fa8c1c41155b1530969f64b2b7f44b1576c92