CCopybara-ServiceAdd WASI platform to Abseil linkopts to avoid linking pthread.
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Add WASI platform to Abseil linkopts to avoid linking pthread. WASI targets are single-threaded and do not support -pthread. This change adds `@platforms//os:wasi` to linkopts in absl/base, absl/debugging, absl/random/internal, and absl/synchronization so that -pthread is omitted when compiling for WASI. PiperOrigin-RevId: 989637373 Change-Id: Ia0ceb05c53c4c3f6ced4932a8add703972b389ee | 4 天前 | |
Explicitly depend on //absl/strings:string_view where used. Traditionally, `//absl/strings` provided string_view.h, but it is its own target now and we should depend on it whenever we include `absl/strings/string_view.h`, see comment here: https://github.com/abseil/abseil-cpp/blob/a690167a55b9e210b7884d311759977c0f5669c9/absl/strings/BUILD.bazel#L94-L99 Apply this strict reading to absl itself. In some cases, this also allowed to remove a dependency on the bigger `//absl/strings` library. PiperOrigin-RevId: 971466003 Change-Id: I8d47f194ba24ae2676b3f083f10b1c46cb07901c | 1 个月前 | |
Improve sorting consistency in CMakeLists.txt PiperOrigin-RevId: 972171567 Change-Id: Ifc1fa8dd369644ac28ed1eeac7e107f5d0ac3cfb | 1 个月前 | |
Internal cleanup PiperOrigin-RevId: 956283836 Change-Id: I015c7f19c70a835441c6dc39ab704d36ce14e120 | 2 个月前 | |
IWYU: Update includes and fix minor spelling mistakes. PiperOrigin-RevId: 697000534 Change-Id: Ia885033535c5e2f57884a922bdcff9db7b565f49 | 1 年前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
Migrate from ABSL_FALLTHROUGH_INTENDED to C++17 [[fallthrough]] PiperOrigin-RevId: 966125682 Change-Id: I4b3afe1a08e918623a18383a06961b39cc45c97b | 1 个月前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
Replace std::TRAIT<...>::value with std::TRAIT_v<...> equivalents PiperOrigin-RevId: 927479222 Change-Id: I70c38e557c8527f72bf86281d88621a5eca26df3 | 3 个月前 | |
Replace std::TRAIT<...>::value with std::TRAIT_v<...> equivalents PiperOrigin-RevId: 927479222 Change-Id: I70c38e557c8527f72bf86281d88621a5eca26df3 | 3 个月前 | |
IWYU: Update includes and fix minor spelling mistakes. PiperOrigin-RevId: 697000534 Change-Id: Ia885033535c5e2f57884a922bdcff9db7b565f49 | 1 年前 | |
Replace std::TRAIT<...>::value with std::TRAIT_v<...> equivalents PiperOrigin-RevId: 927479222 Change-Id: I70c38e557c8527f72bf86281d88621a5eca26df3 | 3 个月前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
In the comment about absl::Exponential(), mention that mean = 1/lambda. PiperOrigin-RevId: 929049316 Change-Id: I59d5efdf9b84459088c0a656ad5ec01841322580 | 3 个月前 | |
Remove empty messages from static_assert now that C++17 supports this PiperOrigin-RevId: 966653770 Change-Id: Ib4f52316df994b92176c3fed09ae5f2f95ac06aa | 1 个月前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
Replace std::TRAIT<...>::value with std::TRAIT_v<...> equivalents PiperOrigin-RevId: 927479222 Change-Id: I70c38e557c8527f72bf86281d88621a5eca26df3 | 3 个月前 | |
Fix and reorder some #includes Some of these direct dependencies were previously indirect/transitive dependencies. They previously worked -- and continue to work -- as they only required header inclusions. They should be mentioned in CMakeLists.txt, which we can handle in a separate commit. PiperOrigin-RevId: 977974961 Change-Id: Iac66449258d7c8c74e6813c72943550e83bff099 | 24 天前 | |
Replace std::TRAIT<...>::value with std::TRAIT_v<...> equivalents PiperOrigin-RevId: 927479222 Change-Id: I70c38e557c8527f72bf86281d88621a5eca26df3 | 3 个月前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
PR #2144: validate log_uniform_int_distribution stream input and harden preconditions Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/2144 log_uniform_int_distribution's param_type constructor computes log_range_ as static_cast<int>(ceil((1/log(base)) * log(range))). A base of 0 or 1, or a negative base for a signed IntType, violates the base > 1 precondition and makes that math non-finite: 1/log(1) divides by zero, and the final cast of inf/NaN to int is undefined behavior (UBSan: "inf is outside the range of representable values of type 'int'"). It was also reachable through operator>>, which handed whatever it parsed straight to param_type. Changes: - Check the param_type preconditions with ABSL_HARDENING_ASSERT. - Only take the log() branch for base_ > 2, so an out-of-contract base never reaches the floating-point math. - Have operator>> validate max >= min and base > 1 and set failbit on bad input instead of constructing an invalid param_type, with a test covering that rejection. Merge b15918e1696ac26b2f283a26c03671a29f9b61a6 into 8bd6e5097d96974f5c85031759c545a8e7426b4a Merging this change closes #2144 PiperOrigin-RevId: 984157679 Change-Id: I003a3dd5536fdac5731850017095915e73ab05bb | 14 天前 | |
PR #2144: validate log_uniform_int_distribution stream input and harden preconditions Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/2144 log_uniform_int_distribution's param_type constructor computes log_range_ as static_cast<int>(ceil((1/log(base)) * log(range))). A base of 0 or 1, or a negative base for a signed IntType, violates the base > 1 precondition and makes that math non-finite: 1/log(1) divides by zero, and the final cast of inf/NaN to int is undefined behavior (UBSan: "inf is outside the range of representable values of type 'int'"). It was also reachable through operator>>, which handed whatever it parsed straight to param_type. Changes: - Check the param_type preconditions with ABSL_HARDENING_ASSERT. - Only take the log() branch for base_ > 2, so an out-of-contract base never reaches the floating-point math. - Have operator>> validate max >= min and base > 1 and set failbit on bad input instead of constructing an invalid param_type, with a test covering that rejection. Merge b15918e1696ac26b2f283a26c03671a29f9b61a6 into 8bd6e5097d96974f5c85031759c545a8e7426b4a Merging this change closes #2144 PiperOrigin-RevId: 984157679 Change-Id: I003a3dd5536fdac5731850017095915e73ab05bb | 14 天前 | |
IWYU: Update includes and fix minor spelling mistakes. PiperOrigin-RevId: 697000534 Change-Id: Ia885033535c5e2f57884a922bdcff9db7b565f49 | 1 年前 | |
Reduce flakiness in MockDistributions.Examples test case. PiperOrigin-RevId: 763928380 Change-Id: I2063b45e660a9601bb52d72963b19803863c5c36 | 1 年前 | |
Remove unnecessary usages of absl::void_t 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 | 5 个月前 | |
Replace std::TRAIT<...>::value with std::TRAIT_v<...> equivalents PiperOrigin-RevId: 927479222 Change-Id: I70c38e557c8527f72bf86281d88621a5eca26df3 | 3 个月前 | |
Add (unused) validation to absl::MockingBitGen `absl::Uniform(tag, rng, a, b)` has some restrictions on the values it can produce in that it will always be in the range specified by `a` and `b`, but these restrictions can be violated by `absl::MockingBitGen`. This makes it easier than necessary to introduce a bug in tests using a mock RNG. We can fix this by making `MockingBitGen` emit a runtime error if the value produced is out of bounds. Immediately fixing all the internal buggy uses of `MockingBitGen` is currently infeasible, so the plan is this: 1. Add turned-off validation to `MockingBitGen` to avoid the costs of maintaining unsubmitted code. 2. Temporarily migrate the internal buggy use cases to keep the current behavior, to be fixed later. 3. Turn on validation for `MockingBitGen`. 4. Fix the internal buggy use cases over time. --- A few of the different categories of errors I found: - `Call(tag, rng, a, b) -> a or b`, for open/half-open intervals (i.e. incorrect boundary condition). This case happens quite a lot, e.g. by specifying `absl::Uniform<double>(rng, 0, 1)` to return `1.0`. - `Call(tag, rng, 0, 1) -> 42` (i.e. return an arbitrary value). These may be straightforward to fix by just returning an in-range value, or sometimes they are difficult to fix because other data structures depend on those values. PiperOrigin-RevId: 635503223 Change-Id: I9293ab78e79450e2b7b682dcb05149f238ecc550 | 2 年前 | |
IWYU: Update includes and fix minor spelling mistakes. PiperOrigin-RevId: 697000534 Change-Id: Ia885033535c5e2f57884a922bdcff9db7b565f49 | 1 年前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
absl/random: Convert absl::BitGen / absl::InsecureBitGen to classes from aliases. PiperOrigin-RevId: 733063284 Change-Id: If0af60b24bcc59b6fe3a6882aebd427b8b10f3a0 | 1 年前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
Export of internal Abseil changes -- c99f979ad34f155fbeeea69b88bdc7458d89a21c by Derek Mauro <dmauro@google.com>: Remove a floating point division by zero test. This isn't testing behavior related to the library, and MSVC warns about it in opt mode. PiperOrigin-RevId: 285220804 -- 68b015491f0dbf1ab547994673281abd1f34cd4b by Gennadiy Rozental <rogeeff@google.com>: This CL introduces following changes to the class FlagImpl: * We eliminate the CommandLineFlagLocks struct. Instead callback guard and callback function are combined into a single CallbackData struct, while primary data lock is stored separately. * CallbackData member of class FlagImpl is initially set to be nullptr and is only allocated and initialized when a flag's callback is being set. For most flags we do not pay for the extra space and extra absl::Mutex now. * Primary data guard is stored in data_guard_ data member. This is a properly aligned character buffer of necessary size. During initialization of the flag we construct absl::Mutex in this space using placement new call. * We now avoid extra value copy after successful attempt to parse value out of string. Instead we swap flag's current value with tentative value we just produced. PiperOrigin-RevId: 285132636 -- ed45d118fb818969eb13094cf7827c885dfc562c by Tom Manshreck <shreck@google.com>: Change null-term* (and nul-term*) to NUL-term* in comments PiperOrigin-RevId: 285036610 -- 729619017944db895ce8d6d29c1995aa2e5628a5 by Derek Mauro <dmauro@google.com>: Use the Posix implementation of thread identity on MinGW. Some versions of MinGW suffer from thread_local bugs. PiperOrigin-RevId: 285022920 -- 39a25493503c76885bc3254c28f66a251c5b5bb0 by Greg Falcon <gfalcon@google.com>: Implementation detail change. Add further ABSL_NAMESPACE_BEGIN and _END annotation macros to files in Abseil. PiperOrigin-RevId: 285012012 GitOrigin-RevId: c99f979ad34f155fbeeea69b88bdc7458d89a21c Change-Id: I4c85d3704e45d11a9ac50d562f39640a6adbedc1 | 6 年前 | |
Simplify some random/internal types; expose one function to acquire entropy. PiperOrigin-RevId: 734243580 Change-Id: Ibc8f3642329b1e7a5a6ed54e505b2ced8dec2f4c | 1 年前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
IWYU: Update includes and fix minor spelling mistakes. PiperOrigin-RevId: 697000534 Change-Id: Ia885033535c5e2f57884a922bdcff9db7b565f49 | 1 年前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
Replace std::TRAIT<...>::value with std::TRAIT_v<...> equivalents PiperOrigin-RevId: 927479222 Change-Id: I70c38e557c8527f72bf86281d88621a5eca26df3 | 3 个月前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 | |
IWYU: Update includes and fix minor spelling mistakes. PiperOrigin-RevId: 697000534 Change-Id: Ia885033535c5e2f57884a922bdcff9db7b565f49 | 1 年前 | |
Add missing #includes PiperOrigin-RevId: 969952142 Change-Id: I29cc35e73cd038c0d2a4520986fb63de5eebdeaf | 1 个月前 |