- Move cpu_detect to absl::base_internal, adding the kNvidiaGrace and kIntelGraniterapids enums.
- On aarch64 Linux, implement custom ISAR0.RNDR checking logic to distinguish kArmNeoverseV2 from kNvidiaGrace.
- Add IsSMTEnabled and NumContextsPerCPU
PiperOrigin-RevId: 922862384
Change-Id: I038b7732714400d6c63ff309bf20af3f436afcf5
Add [[clang::nomerge]] to absl::base_internal::HardeningAbort()
This lets us distinguish crashes due to different hardening checks.
PiperOrigin-RevId: 910658969
Change-Id: I820eb5291d7ce8330df0dac10ea09fafef405bbb
This will let us deprecate the declarations without triggering warnings in Abseil itself.
PiperOrigin-RevId: 906360966
Change-Id: Iee362ac0eac647909ef38003280f1179813f764d
This associates debug information with the assertion sites, allowing clearer stack-traces for assertion failures and better accounting of the performance overhead of assertions.
This change also changes the assertion functions from inline to constexpr, to allow functions using them to be called from static assertions (like optional_ref::operator* in optional_ref's constexpr test).
PiperOrigin-RevId: 903344377
Change-Id: I50166b6cf12a8f139ed3c9fe4f6c6e0f24b51812
This associates debug information with the assertion sites, allowing clearer stack-traces for assertion failures and better accounting of the performance overhead of assertions.
This change also changes the assertion functions from inline to constexpr, to allow functions using them to be called from static assertions (like optional_ref::operator* in optional_ref's constexpr test).
PiperOrigin-RevId: 903309187
Change-Id: Icbe0fd9d0fe9e212036d17468e80833b95b8a82d
This method is in the transitive callgraph of TCMalloc via absl::base_internal::CycleClock::Frequency(). ABSL_RAW_LOG avoids a potential reentrancy/deadlock issue when TCMalloc invokes `Frequency` while holding one of its locks.
PiperOrigin-RevId: 903293020
Change-Id: I4c8310fa32c1e12d049296377c5a9bf069ef513b
Most current uses of ABSL_HARDENING_ASSERT are one of:
* numerical comparison
* checking that a container is non-empty
* checking that a pointer is non-null.
This change adds additional hardening assert functions which conduct the
comparisons necessary for these checks inside the body of the assertion
function, so that the cost of performing the check can be attributed
to the assertion.
For the smaller set of cases where more complex conditions are checked,
a general HardeningAssert which takes a bool is provided.
PiperOrigin-RevId: 899780652
Change-Id: I00602302a5d42d483053ad66d8c3e796d1708567
Most usages of absl::void_t compile fine with std::void_t, so we migrate them here. A few don't compile due to overly eager template instantiations, so we leave those.
PiperOrigin-RevId: 897231619
Change-Id: Iad34101916dac2b995257ebd5d6aacb9a0acfa32
This will let us deprecate the declarations without triggering warnings in Abseil itself.
PiperOrigin-RevId: 894202105
Change-Id: I57bb2a1647be1fedf9b724a07042fd0f564ce074
thread_identity by using a void*, and fix callers to use
base::scheduling::Schedulable::GetBoundSchedulable().
PiperOrigin-RevId: 894096577
Change-Id: I2d4c822c60501e34cadcaac7fc434ef9adb222c3
The current ABSL_HARDENING_ASSERT macros are difficult to observe in stack traces in core dumps or sampling profiler output. This change creates a pair of bounds check functions which can be used in place of some of instances of these ABSL_HARDENING_ASSERT macros while remaining clearly distinguishable in production monitoring infrastructure.
PiperOrigin-RevId: 874680671
Change-Id: Ife503e63076bb92b2a9919f18b42f305d683b99d
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1961
We maintain the V8 Js Compiler on IBM platforms which uses abseil as a dependency. We have recently switched to using Clang and need to create this patch to fix two warnings:
```
warning: implicit conversion changes signedness: 'uint64_t' (aka 'unsigned long') to 'int64_t' (aka 'long') [-Wsign-conversion]
warning: implicit conversion loses integer precision: 'uintptr_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
```
Merge 2e972b5c72 into d71fcd13f6
Merging this change closes#1961
COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1961 from miladfarca:ppc-fix-clang-warn 2e972b5c72
PiperOrigin-RevId: 823581713
Change-Id: Icff10b99b3808f51866fb97576af405826742088
This helps inform Nullability inference without needing any special casing.
Since ABSL_DIE_IF_NULL is allowed for pointers, smart pointers, or classes marked with ABSL_NULLABILITY_COMPATIBLE we introduce a trait to help add the annotation only when compatible. This trait is kept internal for now out of caution for what we are supporting, though people have asked about it before (see b/394789178).
Simple cases are tested by `-Wnonnull` in absl/base/nullability_nc_test.cc. However, it's unclear how to test the complex cases like templates with universal references with the simple compiler `-Wnonnull`. There is a followup nullability inference test (cl/808830606).
Since there is Wnullability-completeness, needed to annotate the rest of die_if_null.h
PiperOrigin-RevId: 810463021
Change-Id: Id5156996bf3a29a99e689974ac2af7b94b21c460
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1918
Fixes build failures on ppc64le with musl libc, where UnscaledCycleClock::Frequency() had no implementation.
This patch adds a fallback for __linux__ + __powerpc64__ when glibc is not present, using a constant 512 MHz timebase frequency. This matches the existing AIX implementation and unblocks projects like Node.js/V8 from building on Alpine Linux (musl).
Tested by building Node.js 24.x on ppc64le + musl.
Issue- https://github.com/abseil/abseil-cpp/issues/1917
Merge aa7e63a4ff into 274c81389f
Merging this change closes#1918
COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1918 from sandeepgupta12:master aa7e63a4ff
PiperOrigin-RevId: 794579241
Change-Id: I16b9bcb48dc9ff7c1f1fcf9b31ceb5f20dadf3ec
This allows dynamic memory allocation for computing stack traces to avoid a stack overflow.
PiperOrigin-RevId: 786512779
Change-Id: Ib5ef8fef436672b99d9678137e3b2bb65ca47eba
As allocations may come from unsized free or delete as well, we indicate these
via std::nullopt.
PiperOrigin-RevId: 780282346
Change-Id: I123b5a0541bdf26e44686de79821dbb1326c4cf6