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.htmlFixes#1473
PiperOrigin-RevId: 539656313
Change-Id: I7a30dd9d3eb6af03a99da0d93d721a86f6521b25
Introduce kHighRefcountMask which masks off flags and the LSb of the refcount value. In the cases where this mask is used, we don't need to check the LSb because we can assume the refcount is 1 when the rest of the masked RefcountAndFlags is empty, and the LSb doesn't matter if the masked value is not empty (either it's immortal or refcount > 1). This saves an instruction and a cycle (and + cmp -> tst) https://godbolt.org/z/Kz69eqfhq
PiperOrigin-RevId: 539151659
Change-Id: I2ec7d72918f052c4b0938edd746af9d5b3052c7e
This fixes an endless loop in the absl Arm stack unwinder where encountering a
second signal return trampoline (as one has in nested signal frames), would restart
unwinding at the outermost signal, resulting in an endless loop.
This does not change any behavior in the non-nested signal case, so I believe
it is safe for any stack that hasn't encountered this bug already.
I would love to test this beyond the absl unwinding test cases and the
fingerprint_test included here, but I'm at a loss for other test cases.
PiperOrigin-RevId: 539113007
Change-Id: I10037f9fa77b45cc4db61f89b9c6380ec3529113
This is a simplification but not a behavior change; we used to choose %u for unsigned ints, but %u and %d generate the same output for these types.
PiperOrigin-RevId: 539104599
Change-Id: I9d7ff561b969a6287889f95063636d6b77a4a78b
This patch makes it use `memcpy` for performance and consistency with other overloads.
PiperOrigin-RevId: 539079130
Change-Id: I5aea9dd9b8a1ce708c787df7d6c9a75ae419c484
in NACL pthread_self() returns a pointer that isn't directly convertible to arithmetic type.
PiperOrigin-RevId: 539023020
Change-Id: I3745ec5565f3a99ccb1d9df12c27a80e57ca4755
This is only a workaround, working only with gcc/clang, while waiting
for a better long term fix not using std::aligned_storage, which is
tracked by b/260219225.
This test allows us to modify the behavior in this space without introducing undesired changes elsewhere.
PiperOrigin-RevId: 537981963
Change-Id: Icda91b66efcc0dc8c263011b137e130a3db2dc19
Note that RE2 has taken a dependency on Abseil, so the `main` branch
should be used from now on. The `abseil` branch will go away soon...
PiperOrigin-RevId: 536941231
Change-Id: I502fc643a3763de51292396297b0939613473485
Motivation is for WebAssembly to avoid perror which in turn requires file system emulation.
PiperOrigin-RevId: 536737294
Change-Id: I5177064c9451fb630ec5e9d0c0a0679fabd98afa
This avoids the need to use filesystem APIs just to write to stderr, which emscripten implements the same as this under the hood.
PiperOrigin-RevId: 536525710
Change-Id: I0a647a4593eacfba324505b6e8c4acfb577ac839
the cyclecounter by default, since it may be unsafe in some situations
(for example, if the system may enter a sleep state).
Fixes#1460
PiperOrigin-RevId: 535641718
Change-Id: I41c9cc4bc7a8ae7280ff9df00abd57668205045b
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
hash_test.cc leans heavily on INSTANTIATE_TYPED_TEST_SUITE_P, which is
quite memory- and CPU-hungry. Split a few heavyweight tests into a new
hash_instantiated_test.cc, reducing peak RAM consumption (or, on
multicore systems, compilation time).
PiperOrigin-RevId: 535305679
Change-Id: Ic204da0a47c749c3f7db5f902ade8d74ed3043bb
`_LINUX_SOURCE_COMPAT` needs to be defined to fix
absl/status/status.cc:494:5: error: duplicate case value
494 | case ENOTEMPTY: // Directory not empty
| ^~~~
absl/status/status.cc:480:5: note: previously used here
480 | case EEXIST: // File exists
| ^~~~
The non-RAW_ versions provide better output but weren't available when most of these tests were written.
There are just a couple spots where RAW_ is actually needed, e.g. signal handlers and malloc hooks.
Also fix a couple warnings in layout_test.cc newly surfaced because the optimizer understands CHECK_XX differently than INTERNAL_CHECK.
PiperOrigin-RevId: 534584435
Change-Id: I8d36fa809ffdaae5a3813064bd602cb8611c1613
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1452
__cpuid is declared in intrin.h, but is excluded on non-Windows platforms.
We add this declaration to compensate.
Fixes#1358
PiperOrigin-RevId: 534449804
Change-Id: I91027f79d8d52c4da428d5c3a53e2cec00825c13
This includes an upgrade to CMake 3.26.3 and Bazel 6.2.0
This change includes support for both GCC 12 and 13 since we
were only testing GCC 11 before this change.
PiperOrigin-RevId: 534235753
Change-Id: I4183a02469b1c3425c52a31b71fcefe403315a42
This uses the same flags that Clang based builds use for Windows/Linux.
A future change will add floating point related flags and some warning
suppressions. So, we clone the section rather than just change the check
at line 77.
Fixes#1450