Commit Graph

1604 Commits

Author SHA1 Message Date
Derek Mauro
4500c2fada DirectMmap: Use off_t instead of off64_t for the offset parameter
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
2023-06-12 08:12:42 -07:00
Connal de Souza
1feab4fff9 Optimize Cord Refcount decrement.
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
2023-06-09 12:39:02 -07:00
Copybara-Service
e929ede411 Merge pull request #1472 from pateldeev:iv
PiperOrigin-RevId: 539145188
Change-Id: Ic8dc8112f77ca720a8871de57ee389f15693ab00
2023-06-09 12:11:45 -07:00
Abseil Team
2b042424db Fix unwinding through nested signal frames on aarch64.
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
2023-06-09 10:11:36 -07:00
Greg Falcon
0f4133aacf StrFormat() simplification: Treat %v unconditionally as %d when formatting integers.
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
2023-06-09 09:39:14 -07:00
Abseil Team
163cade864 Import of CCTZ from GitHub.
PiperOrigin-RevId: 539104398
Change-Id: I6385662e0c5694d40c57887f983b16adc9eced14
2023-06-09 09:38:12 -07:00
Abseil Team
87ce390379 The previous code was using memmove under the hood (string::append).
This patch makes it use `memcpy` for performance and consistency with other overloads.

PiperOrigin-RevId: 539079130
Change-Id: I5aea9dd9b8a1ce708c787df7d6c9a75ae419c484
2023-06-09 07:47:12 -07:00
Abseil Team
66eae02ea7 Implement GetTID for NACL platform.
in NACL pthread_self() returns a pointer that isn't directly convertible to arithmetic type.

PiperOrigin-RevId: 539023020
Change-Id: I3745ec5565f3a99ccb1d9df12c27a80e57ca4755
2023-06-09 02:28:32 -07:00
pateldeev
1524b1ac07 Use InlinedVector 2023-06-08 20:53:28 -07:00
Copybara-Service
afc9206b3d Merge pull request #1471 from wenshan1:blan-add-VxWorks-support
PiperOrigin-RevId: 538778978
Change-Id: I0c04b09987eb4d97892825e3c994656d4e300f60
2023-06-08 07:28:34 -07:00
Copybara-Service
ae87791869 Merge pull request #1468 from Romain-Geissler-1A:silence-aligned_storage-warning
PiperOrigin-RevId: 538651091
Change-Id: Id1aa7ab287beb252f4826f70e26b7e3bfa80c462
2023-06-07 18:46:48 -07:00
Bin Lan
872d99b48d Add VxWorks support 2023-06-08 09:38:42 +08:00
Copybara-Service
d49a30a81e Merge pull request #1466 from traversaro:patch-2
PiperOrigin-RevId: 538534137
Change-Id: Ifb2e59c36ffce183d3c93081d9300201757f82d4
2023-06-07 10:52:15 -07:00
Derek Mauro
bb6f5ff1c0 Remove redundant redeclarations causing -Wredundant-decls warnings
Fixes #1469

PiperOrigin-RevId: 538534014
Change-Id: Iab84f73c0a0665355b614e85c62f686dc54c8671
2023-06-07 10:51:09 -07:00
Copybara-Service
181480b1d0 Merge pull request #1458 from juergbi:aix
PiperOrigin-RevId: 538488164
Change-Id: I680dcbc2f27dca3beba416b3cd0a55943751cf4c
2023-06-07 08:00:48 -07:00
Gennadiy Rozental
86aaa72a33 Update XML output to properly print special characters. Non printable characters are skipped in output. All the "whitespace-like" (including \t, \r, \n) characters printed as plain space ' '.
PiperOrigin-RevId: 538479923
Change-Id: I62dff39bb21f376d00a7b9480f8f1d31d7015e45
2023-06-07 07:25:07 -07:00
Abseil Team
1285ca4b4f Import of CCTZ from GitHub.
PiperOrigin-RevId: 538241594
Change-Id: Ie6f0d913bcf07dea2f33e47198ba952b3800d70e
2023-06-06 11:24:54 -07:00
Romain Geissler
c3b5a293aa Silence std::aligned_storage warnings in C++23 mode.
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.
2023-06-06 14:18:42 +00:00
Greg Falcon
66406fdf15 Add a unit test that captures the current behavior of formatting of char types and char-backed enum types through StrCat(), StrFormat("%v"), and Substitute().
This test allows us to modify the behavior in this space without introducing undesired changes elsewhere.

PiperOrigin-RevId: 537981963
Change-Id: Icda91b66efcc0dc8c263011b137e130a3db2dc19
2023-06-05 14:28:21 -07:00
Abseil Team
7a74153a05 Import of CCTZ from GitHub.
PiperOrigin-RevId: 537825067
Change-Id: I3ce8712d5130068fb7d77b563eb502e2e9560810
2023-06-05 03:36:58 -07:00
Silvio Traversaro
f6c72c3ce8 CMake: Add absl::abseil_dll ALIAS target for abseil_dll 2023-06-04 12:52:15 +02:00
Abseil Team
77ba7ca9d2 Lifetime checks for absl::StrSplit()
PiperOrigin-RevId: 537400816
Change-Id: I06794a6b8b6a441e34121047024380190d42869a
2023-06-02 13:50:21 -07:00
Dino Radakovic
55de7357c7 absl: Replace absl::remove_cv_t<absl::remove_reference_t<T>> with absl::remove_cvref_t<T>
PiperOrigin-RevId: 537372070
Change-Id: I46ff6e42856aea2cd8da6ff7105cf58613603dd4
2023-06-02 11:58:17 -07:00
Abseil Team
e9bb35cea3 Adding support for int128 and uint128 flag types
PiperOrigin-RevId: 537120102
Change-Id: I7952e53aca10319eb433e4c4d60cf3d7fe74d19a
2023-06-01 13:52:23 -07:00
Copybara-Service
01e628d2c8 Merge pull request #1457 from juergbi:time-threads
PiperOrigin-RevId: 537088042
Change-Id: I6ef219a1a76baf3a751a6084a8fb8639c9bdac51
2023-06-01 11:52:21 -07:00
Copybara-Service
1561ee614e Merge pull request #1463 from kuszmaul:indicative
PiperOrigin-RevId: 537078029
Change-Id: Ibf0be0a8e83f62d492e96f1f1ed7839dbde30fae
2023-06-01 11:18:52 -07:00
Paul Wankadia
71ffb09f8c Update Abseil to RE2 release 2023-06-01.
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
2023-06-01 00:43:44 -07:00
Bradley C. Kuszmaul
182925b7c0 Convert raw_hash_set comments from imperative to indicative mood.
https://google.github.io/styleguide/cppguide.html#Function_Comments
2023-05-31 16:10:59 -04:00
Copybara-Service
8c466401a3 Merge pull request #1462 from kuszmaul:fix-typo
PiperOrigin-RevId: 536785792
Change-Id: I2963dea81a75b01b7275d784f6a2908816d0c7bf
2023-05-31 12:12:53 -07:00
Abseil Team
6f72305f95 Switch from perror to ABSL_INTERNAL_LOG.
Motivation is for WebAssembly to avoid perror which in turn requires file system emulation.

PiperOrigin-RevId: 536737294
Change-Id: I5177064c9451fb630ec5e9d0c0a0679fabd98afa
2023-05-31 09:32:32 -07:00
Abseil Team
e077941c43 For web assembly, implement WriteToStderr as emscripten_err.
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
2023-05-30 15:29:44 -07:00
Bradley C. Kuszmaul
75fb27c5d3 Typo gardening 2023-05-30 10:02:25 -04:00
Derek Mauro
8e45685002 Disable the use of the fast GetCurrentTimeNanos() algorithm based on
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
2023-05-26 09:44:21 -07:00
Abseil Team
0f718c568b Add support for stateful allocators to absl::FixedArray.
PiperOrigin-RevId: 535534819
Change-Id: Iccf8da3e0b084131e4c0dba205f3e190d3a66f4e
2023-05-26 00:28:44 -07:00
Andy Getzendanner
88cc63ef73 Implement a better GetTID on Apple platforms, and a better fallback too.
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
2023-05-25 11:32:45 -07:00
Benjamin Barenblat
c154d20abc Split absl/hash/hash_test.cc into two files
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
2023-05-25 10:41:35 -07:00
Andy Getzendanner
4e4b48faad Note that AsyncSignalSafeWriteToStderr preserves errno, and inline one use of it into a lambda.
PiperOrigin-RevId: 535245982
Change-Id: I816f60c8b6476536df6836500f01c9a3ad88ddd4
2023-05-25 07:10:52 -07:00
Copybara-Service
c3e9485bdc Merge pull request #1454 from niranjan-nilakantan:niranjan-nilakantan/issue1450
PiperOrigin-RevId: 534841675
Change-Id: I6fbee6f0fe61d8dd51c9c7d93c3b47684a2f4d9f
2023-05-24 08:04:04 -07:00
Abseil Team
7d7defda38 fill ABSL_INTERNAL_(DISABLE|RESTORE)_DEPRECATED_DECLARATION_WARNING macro for clang
PiperOrigin-RevId: 534824761
Change-Id: I0ab78fcb211bc5df756fb581761ed8febc3d18fd
2023-05-24 07:11:32 -07:00
Jürg Billeter
339c79d405 absl/status: Fix build on AIX
`_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
          |     ^~~~
2023-05-24 09:41:02 +02:00
Jürg Billeter
44606a0df5 absl/base: Fix build on AIX
The AIX assembler doesn't support numeric labels. Use a relative jump
instead to fix

    Assembler:
    /tmp/ccw16WCt.s: line 25: Error In Syntax
2023-05-24 09:27:14 +02:00
Jürg Billeter
c24ead7ffa CMake: Link time_zone library to Threads::Threads
`time_zone_impl.cc` uses `std::mutex`.
2023-05-24 08:36:39 +02:00
Copybara-Service
d23adc1cfb Merge pull request #1455 from juergbi:solaris
PiperOrigin-RevId: 534619764
Change-Id: Ied99569176766f9708d5504eac9c7024cdcfd64b
2023-05-23 17:44:36 -07:00
Andy Getzendanner
5274782148 Migrate most RAW_LOGs and RAW_CHECKs in tests to regular LOG and CHECK.
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
2023-05-23 15:47:23 -07:00
niranjan-nilakantan
79ca5d7aad Add a declaration for __cpuid for the IntelLLVM compiler.
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
2023-05-23 09:27:54 -07:00
Jürg Billeter
962e8be180 absl/debugging: Fix build on Solaris 2023-05-23 12:11:07 +02:00
Derek Mauro
9d43470921 CI: Move the GCC-latest testing to GCC 13.1 on Linux
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
2023-05-22 17:28:30 -07:00
Abseil Team
830dabdbf3 Rollback of add a declaration for __cpuid for the IntelLLVM compiler.
PiperOrigin-RevId: 534213948
Change-Id: I56b897060b9afe9d3d338756c80e52f421653b55
2023-05-22 16:06:03 -07:00
Niranjan Nilakantan
7723d9a155 Clone the Clang flags section for IntelLLVM.
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
2023-05-22 14:43:35 -07:00
Copybara-Service
051aa9805f Merge pull request #1452 from niranjan-nilakantan:niranjan-nilakantan/issue1358
PiperOrigin-RevId: 534179290
Change-Id: I9ad24518cc6a336fbaf602269fb01319491c8b60
2023-05-22 14:15:08 -07:00