re2 1.24.0 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -20
- package/README.md +63 -4
- package/binding.gyp +1 -2
- package/lib/addon.cc +9 -5
- package/lib/exec.cc +4 -4
- package/lib/match.cc +4 -4
- package/lib/new.cc +6 -6
- package/lib/pattern.cc +148 -1
- package/lib/replace.cc +5 -4
- package/lib/search.cc +1 -1
- package/lib/set.cc +85 -10
- package/lib/test.cc +1 -1
- package/lib/unicode_properties.h +15840 -0
- package/lib/wrapped_re2.h +40 -4
- package/lib/wrapped_re2_set.h +3 -1
- package/llms-full.txt +497 -0
- package/llms.txt +135 -0
- package/package.json +19 -11
- package/re2.d.ts +2 -0
- package/re2.js +1 -0
- package/vendor/abseil-cpp/CMake/AbseilDll.cmake +87 -74
- package/vendor/abseil-cpp/CMakeLists.txt +3 -3
- package/vendor/abseil-cpp/FAQ.md +130 -79
- package/vendor/abseil-cpp/MODULE.bazel +6 -7
- package/vendor/abseil-cpp/absl/BUILD.bazel +6 -0
- package/vendor/abseil-cpp/absl/algorithm/BUILD.bazel +4 -0
- package/vendor/abseil-cpp/absl/algorithm/CMakeLists.txt +4 -0
- package/vendor/abseil-cpp/absl/algorithm/algorithm.h +34 -2
- package/vendor/abseil-cpp/absl/algorithm/container.h +164 -17
- package/vendor/abseil-cpp/absl/algorithm/container_test.cc +390 -13
- package/vendor/abseil-cpp/absl/base/BUILD.bazel +53 -6
- package/vendor/abseil-cpp/absl/base/CMakeLists.txt +28 -4
- package/vendor/abseil-cpp/absl/base/attributes.h +61 -42
- package/vendor/abseil-cpp/absl/base/call_once.h +1 -0
- package/vendor/abseil-cpp/absl/base/casts.h +8 -1
- package/vendor/abseil-cpp/absl/base/casts_test.cc +3 -6
- package/vendor/abseil-cpp/absl/base/config.h +53 -9
- package/vendor/abseil-cpp/absl/base/exception_safety_testing_test.cc +9 -9
- package/vendor/abseil-cpp/absl/base/fast_type_id.h +30 -2
- package/vendor/abseil-cpp/absl/base/fast_type_id_test.cc +3 -0
- package/vendor/abseil-cpp/absl/base/internal/exception_safety_testing.h +15 -12
- package/vendor/abseil-cpp/absl/base/internal/hardening.h +136 -0
- package/vendor/abseil-cpp/absl/base/internal/hardening_test.cc +168 -0
- package/vendor/abseil-cpp/absl/base/internal/iterator_traits.h +2 -2
- package/vendor/abseil-cpp/absl/base/internal/low_level_alloc.cc +6 -0
- package/vendor/abseil-cpp/absl/base/internal/low_level_scheduling.h +77 -15
- package/vendor/abseil-cpp/absl/base/internal/sysinfo.cc +1 -2
- package/vendor/abseil-cpp/absl/base/internal/thread_identity.h +52 -0
- package/vendor/abseil-cpp/absl/base/internal/unscaledcycleclock.h +5 -0
- package/vendor/abseil-cpp/absl/base/macros.h +36 -20
- package/vendor/abseil-cpp/absl/base/nullability.h +4 -3
- package/vendor/abseil-cpp/absl/base/optimization.h +3 -2
- package/vendor/abseil-cpp/absl/base/optimization_test.cc +4 -3
- package/vendor/abseil-cpp/absl/base/options.h +55 -1
- package/vendor/abseil-cpp/absl/base/policy_checks.h +5 -5
- package/vendor/abseil-cpp/absl/base/{internal/throw_delegate.cc → throw_delegate.cc} +9 -7
- package/vendor/abseil-cpp/absl/base/{internal/throw_delegate.h → throw_delegate.h} +4 -14
- package/vendor/abseil-cpp/absl/base/throw_delegate_test.cc +19 -28
- package/vendor/abseil-cpp/absl/cleanup/BUILD.bazel +2 -0
- package/vendor/abseil-cpp/absl/cleanup/CMakeLists.txt +2 -0
- package/vendor/abseil-cpp/absl/cleanup/cleanup.h +3 -2
- package/vendor/abseil-cpp/absl/cleanup/internal/cleanup.h +3 -2
- package/vendor/abseil-cpp/absl/container/BUILD.bazel +19 -7
- package/vendor/abseil-cpp/absl/container/CMakeLists.txt +6 -5
- package/vendor/abseil-cpp/absl/container/btree_benchmark.cc +3 -5
- package/vendor/abseil-cpp/absl/container/btree_set.h +5 -5
- package/vendor/abseil-cpp/absl/container/btree_test.cc +11 -14
- package/vendor/abseil-cpp/absl/container/chunked_queue.h +8 -6
- package/vendor/abseil-cpp/absl/container/chunked_queue_test.cc +5 -5
- package/vendor/abseil-cpp/absl/container/fixed_array.h +14 -13
- package/vendor/abseil-cpp/absl/container/fixed_array_test.cc +3 -3
- package/vendor/abseil-cpp/absl/container/flat_hash_map.h +18 -6
- package/vendor/abseil-cpp/absl/container/flat_hash_map_test.cc +34 -1
- package/vendor/abseil-cpp/absl/container/flat_hash_set.h +21 -7
- package/vendor/abseil-cpp/absl/container/flat_hash_set_test.cc +39 -7
- package/vendor/abseil-cpp/absl/container/inlined_vector.h +29 -29
- package/vendor/abseil-cpp/absl/container/inlined_vector_test.cc +2 -2
- package/vendor/abseil-cpp/absl/container/internal/btree.h +32 -24
- package/vendor/abseil-cpp/absl/container/internal/btree_container.h +16 -17
- package/vendor/abseil-cpp/absl/container/internal/common.h +6 -5
- package/vendor/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -1
- package/vendor/abseil-cpp/absl/container/internal/compressed_tuple.h +16 -16
- package/vendor/abseil-cpp/absl/container/internal/compressed_tuple_test.cc +13 -13
- package/vendor/abseil-cpp/absl/container/internal/container_memory.h +41 -31
- package/vendor/abseil-cpp/absl/container/internal/hash_function_defaults.h +2 -2
- package/vendor/abseil-cpp/absl/container/internal/hash_generator_testing.h +4 -4
- package/vendor/abseil-cpp/absl/container/internal/hash_policy_traits.h +3 -3
- package/vendor/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +27 -19
- package/vendor/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +2 -2
- package/vendor/abseil-cpp/absl/container/internal/hashtablez_sampler.h +0 -17
- package/vendor/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc +12 -30
- package/vendor/abseil-cpp/absl/container/internal/inlined_vector.h +28 -28
- package/vendor/abseil-cpp/absl/container/internal/layout.h +13 -13
- package/vendor/abseil-cpp/absl/container/internal/layout_test.cc +3 -2
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_map.h +60 -62
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set.cc +59 -39
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set.h +619 -326
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc +25 -2
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set_probe_benchmark.cc +4 -4
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set_test.cc +575 -159
- package/vendor/abseil-cpp/absl/container/linked_hash_map.h +2 -2
- package/vendor/abseil-cpp/absl/container/node_hash_map.h +27 -15
- package/vendor/abseil-cpp/absl/container/node_hash_map_test.cc +34 -0
- package/vendor/abseil-cpp/absl/container/node_hash_set.h +25 -11
- package/vendor/abseil-cpp/absl/container/node_hash_set_test.cc +39 -7
- package/vendor/abseil-cpp/absl/container/sample_element_size_test.cc +7 -4
- package/vendor/abseil-cpp/absl/crc/BUILD.bazel +0 -1
- package/vendor/abseil-cpp/absl/crc/CMakeLists.txt +2 -3
- package/vendor/abseil-cpp/absl/crc/crc32c_benchmark.cc +2 -1
- package/vendor/abseil-cpp/absl/crc/internal/cpu_detect.cc +6 -6
- package/vendor/abseil-cpp/absl/crc/internal/crc.cc +4 -6
- package/vendor/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +41 -0
- package/vendor/abseil-cpp/absl/crc/internal/crc_internal.h +0 -16
- package/vendor/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +143 -81
- package/vendor/abseil-cpp/absl/debugging/BUILD.bazel +9 -31
- package/vendor/abseil-cpp/absl/debugging/CMakeLists.txt +3 -33
- package/vendor/abseil-cpp/absl/debugging/internal/demangle_rust.h +8 -0
- package/vendor/abseil-cpp/absl/debugging/internal/demangle_test.cc +2 -1
- package/vendor/abseil-cpp/absl/debugging/internal/examine_stack.cc +12 -2
- package/vendor/abseil-cpp/absl/debugging/internal/examine_stack.h +2 -3
- package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +11 -0
- package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +13 -4
- package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +14 -7
- package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +4 -0
- package/vendor/abseil-cpp/absl/debugging/internal/symbolize.h +46 -36
- package/vendor/abseil-cpp/absl/debugging/stacktrace.cc +18 -58
- package/vendor/abseil-cpp/absl/debugging/stacktrace.h +5 -48
- package/vendor/abseil-cpp/absl/debugging/stacktrace_test.cc +10 -124
- package/vendor/abseil-cpp/absl/debugging/symbolize.cc +20 -2
- package/vendor/abseil-cpp/absl/debugging/symbolize_elf.inc +58 -106
- package/vendor/abseil-cpp/absl/debugging/symbolize_test.cc +37 -36
- package/vendor/abseil-cpp/absl/debugging/symbolize_unimplemented.inc +4 -4
- package/vendor/abseil-cpp/absl/flags/BUILD.bazel +6 -3
- package/vendor/abseil-cpp/absl/flags/CMakeLists.txt +1 -1
- package/vendor/abseil-cpp/absl/flags/commandlineflag.h +8 -6
- package/vendor/abseil-cpp/absl/flags/commandlineflag_test.cc +1 -1
- package/vendor/abseil-cpp/absl/flags/flag_benchmark.cc +5 -5
- package/vendor/abseil-cpp/absl/flags/flag_test.cc +30 -30
- package/vendor/abseil-cpp/absl/flags/internal/flag.cc +4 -4
- package/vendor/abseil-cpp/absl/flags/internal/flag.h +6 -6
- package/vendor/abseil-cpp/absl/flags/marshalling.h +2 -28
- package/vendor/abseil-cpp/absl/flags/marshalling_test.cc +12 -11
- package/vendor/abseil-cpp/absl/flags/reflection_test.cc +1 -1
- package/vendor/abseil-cpp/absl/functional/BUILD.bazel +26 -1
- package/vendor/abseil-cpp/absl/functional/CMakeLists.txt +29 -1
- package/vendor/abseil-cpp/absl/functional/any_invocable.h +13 -14
- package/vendor/abseil-cpp/absl/functional/any_invocable_test.cc +46 -47
- package/vendor/abseil-cpp/absl/functional/bind_back.h +79 -0
- package/vendor/abseil-cpp/absl/functional/bind_back_test.cc +237 -0
- package/vendor/abseil-cpp/absl/functional/bind_front.h +7 -1
- package/vendor/abseil-cpp/absl/functional/bind_front_test.cc +4 -4
- package/vendor/abseil-cpp/absl/functional/function_ref_test.cc +2 -2
- package/vendor/abseil-cpp/absl/functional/internal/any_invocable.h +28 -28
- package/vendor/abseil-cpp/absl/functional/internal/back_binder.h +95 -0
- package/vendor/abseil-cpp/absl/functional/internal/front_binder.h +4 -4
- package/vendor/abseil-cpp/absl/functional/internal/function_ref.h +2 -2
- package/vendor/abseil-cpp/absl/functional/overload_test.cc +13 -13
- package/vendor/abseil-cpp/absl/hash/BUILD.bazel +1 -2
- package/vendor/abseil-cpp/absl/hash/CMakeLists.txt +1 -2
- package/vendor/abseil-cpp/absl/hash/hash.h +1 -1
- package/vendor/abseil-cpp/absl/hash/hash_test.cc +14 -20
- package/vendor/abseil-cpp/absl/hash/hash_testing.h +11 -9
- package/vendor/abseil-cpp/absl/hash/internal/city.cc +39 -51
- package/vendor/abseil-cpp/absl/hash/internal/hash.cc +165 -47
- package/vendor/abseil-cpp/absl/hash/internal/hash.h +86 -27
- package/vendor/abseil-cpp/absl/hash/internal/low_level_hash_test.cc +36 -1
- package/vendor/abseil-cpp/absl/hash/internal/spy_hash_state.h +8 -5
- package/vendor/abseil-cpp/absl/log/BUILD.bazel +5 -2
- package/vendor/abseil-cpp/absl/log/CMakeLists.txt +5 -3
- package/vendor/abseil-cpp/absl/log/absl_vlog_is_on.h +0 -2
- package/vendor/abseil-cpp/absl/log/internal/BUILD.bazel +15 -1
- package/vendor/abseil-cpp/absl/log/internal/log_message.cc +5 -4
- package/vendor/abseil-cpp/absl/log/internal/log_message.h +14 -0
- package/vendor/abseil-cpp/absl/log/internal/nullstream.h +1 -1
- package/vendor/abseil-cpp/absl/log/internal/proto.cc +13 -0
- package/vendor/abseil-cpp/absl/log/internal/structured_proto.cc +5 -5
- package/vendor/abseil-cpp/absl/log/internal/structured_proto.h +6 -5
- package/vendor/abseil-cpp/absl/log/internal/structured_proto_test.cc +3 -3
- package/vendor/abseil-cpp/absl/log/internal/vlog_config.cc +2 -2
- package/vendor/abseil-cpp/absl/log/internal/vlog_config_benchmark.cc +3 -3
- package/vendor/abseil-cpp/absl/log/log_format_test.cc +19 -2
- package/vendor/abseil-cpp/absl/log/log_modifier_methods_test.cc +18 -0
- package/vendor/abseil-cpp/absl/log/log_streamer.h +29 -2
- package/vendor/abseil-cpp/absl/log/log_streamer_test.cc +18 -0
- package/vendor/abseil-cpp/absl/log/scoped_mock_log_test.cc +1 -1
- package/vendor/abseil-cpp/absl/log/vlog_is_on.h +0 -2
- package/vendor/abseil-cpp/absl/log/vlog_is_on_test.cc +6 -5
- package/vendor/abseil-cpp/absl/memory/memory.h +55 -5
- package/vendor/abseil-cpp/absl/memory/memory_test.cc +55 -1
- package/vendor/abseil-cpp/absl/meta/BUILD.bazel +2 -0
- package/vendor/abseil-cpp/absl/meta/internal/requires.h +1 -1
- package/vendor/abseil-cpp/absl/meta/type_traits.h +119 -55
- package/vendor/abseil-cpp/absl/meta/type_traits_test.cc +7 -7
- package/vendor/abseil-cpp/absl/numeric/int128_test.cc +6 -6
- package/vendor/abseil-cpp/absl/profiling/BUILD.bazel +3 -1
- package/vendor/abseil-cpp/absl/profiling/hashtable.cc +0 -4
- package/vendor/abseil-cpp/absl/profiling/internal/profile_builder.cc +32 -33
- package/vendor/abseil-cpp/absl/profiling/internal/profile_builder.h +25 -2
- package/vendor/abseil-cpp/absl/profiling/internal/sample_recorder_test.cc +8 -5
- package/vendor/abseil-cpp/absl/random/BUILD.bazel +13 -1
- package/vendor/abseil-cpp/absl/random/CMakeLists.txt +23 -2
- package/vendor/abseil-cpp/absl/random/benchmarks.cc +1 -1
- package/vendor/abseil-cpp/absl/random/beta_distribution.h +2 -2
- package/vendor/abseil-cpp/absl/random/bit_gen_ref.h +26 -53
- package/vendor/abseil-cpp/absl/random/bit_gen_ref_test.cc +43 -0
- package/vendor/abseil-cpp/absl/random/discrete_distribution.h +1 -1
- package/vendor/abseil-cpp/absl/random/distributions.h +17 -17
- package/vendor/abseil-cpp/absl/random/distributions_test.cc +4 -4
- package/vendor/abseil-cpp/absl/random/exponential_distribution.h +1 -1
- package/vendor/abseil-cpp/absl/random/internal/BUILD.bazel +4 -2
- package/vendor/abseil-cpp/absl/random/internal/distribution_caller.h +8 -21
- package/vendor/abseil-cpp/absl/random/internal/fast_uniform_bits.h +1 -1
- package/vendor/abseil-cpp/absl/random/internal/generate_real.h +1 -1
- package/vendor/abseil-cpp/absl/random/internal/iostream_state_saver.h +2 -2
- package/vendor/abseil-cpp/absl/random/internal/iostream_state_saver_test.cc +3 -2
- package/vendor/abseil-cpp/absl/random/internal/mock_helpers.h +14 -40
- package/vendor/abseil-cpp/absl/random/internal/nonsecure_base.h +2 -2
- package/vendor/abseil-cpp/absl/random/internal/nonsecure_base_test.cc +2 -2
- package/vendor/abseil-cpp/absl/random/internal/pcg_engine.h +6 -6
- package/vendor/abseil-cpp/absl/random/internal/pcg_engine_test.cc +3 -2
- package/vendor/abseil-cpp/absl/random/internal/randen_detect.cc +6 -6
- package/vendor/abseil-cpp/absl/random/internal/randen_engine.h +2 -2
- package/vendor/abseil-cpp/absl/random/internal/randen_engine_test.cc +3 -2
- package/vendor/abseil-cpp/absl/random/internal/randen_test.cc +3 -2
- package/vendor/abseil-cpp/absl/random/internal/salted_seed_seq.h +6 -5
- package/vendor/abseil-cpp/absl/random/internal/seed_material.cc +4 -4
- package/vendor/abseil-cpp/absl/random/internal/seed_material.h +2 -1
- package/vendor/abseil-cpp/absl/random/internal/traits.h +21 -0
- package/vendor/abseil-cpp/absl/random/internal/traits_test.cc +5 -0
- package/vendor/abseil-cpp/absl/random/internal/uniform_helper.h +23 -23
- package/vendor/abseil-cpp/absl/random/internal/uniform_helper_test.cc +2 -1
- package/vendor/abseil-cpp/absl/random/mocking_access.h +74 -0
- package/vendor/abseil-cpp/absl/random/mocking_bit_gen.h +9 -19
- package/vendor/abseil-cpp/absl/random/uniform_real_distribution.h +1 -1
- package/vendor/abseil-cpp/absl/status/BUILD.bazel +81 -0
- package/vendor/abseil-cpp/absl/status/CMakeLists.txt +91 -0
- package/vendor/abseil-cpp/absl/status/internal/status_internal.cc +63 -18
- package/vendor/abseil-cpp/absl/status/internal/status_internal.h +26 -2
- package/vendor/abseil-cpp/absl/status/internal/status_matchers.h +22 -8
- package/vendor/abseil-cpp/absl/status/internal/statusor_internal.h +43 -43
- package/vendor/abseil-cpp/absl/status/status.cc +62 -70
- package/vendor/abseil-cpp/absl/status/status.h +249 -23
- package/vendor/abseil-cpp/absl/status/status_benchmark.cc +12 -0
- package/vendor/abseil-cpp/absl/status/status_builder.cc +196 -0
- package/vendor/abseil-cpp/absl/status/status_builder.h +978 -0
- package/vendor/abseil-cpp/absl/status/status_builder_test.cc +380 -0
- package/vendor/abseil-cpp/absl/status/status_macros.h +484 -0
- package/vendor/abseil-cpp/absl/status/status_macros_test.cc +634 -0
- package/vendor/abseil-cpp/absl/status/status_matchers.h +2 -1
- package/vendor/abseil-cpp/absl/status/status_matchers_test.cc +3 -4
- package/vendor/abseil-cpp/absl/status/status_payload_printer.h +3 -2
- package/vendor/abseil-cpp/absl/status/status_test.cc +443 -13
- package/vendor/abseil-cpp/absl/status/statusor.h +69 -36
- package/vendor/abseil-cpp/absl/status/statusor_test.cc +132 -35
- package/vendor/abseil-cpp/absl/strings/BUILD.bazel +42 -7
- package/vendor/abseil-cpp/absl/strings/CMakeLists.txt +33 -4
- package/vendor/abseil-cpp/absl/strings/ascii.h +1 -2
- package/vendor/abseil-cpp/absl/strings/atod_manual_test.cc +5 -5
- package/vendor/abseil-cpp/absl/strings/cord.cc +26 -7
- package/vendor/abseil-cpp/absl/strings/cord.h +23 -13
- package/vendor/abseil-cpp/absl/strings/cord_buffer.h +4 -2
- package/vendor/abseil-cpp/absl/strings/cord_test.cc +85 -9
- package/vendor/abseil-cpp/absl/strings/escaping.cc +183 -35
- package/vendor/abseil-cpp/absl/strings/escaping.h +12 -2
- package/vendor/abseil-cpp/absl/strings/escaping_benchmark.cc +1 -3
- package/vendor/abseil-cpp/absl/strings/escaping_test.cc +22 -18
- package/vendor/abseil-cpp/absl/strings/has_absl_stringify_test.cc +2 -2
- package/vendor/abseil-cpp/absl/strings/has_ostream_operator_test.cc +2 -2
- package/vendor/abseil-cpp/absl/strings/internal/append_and_overwrite.h +10 -10
- package/vendor/abseil-cpp/absl/strings/internal/cordz_sample_token_test.cc +1 -1
- package/vendor/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +6 -0
- package/vendor/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +1 -0
- package/vendor/abseil-cpp/absl/strings/internal/escaping.cc +0 -141
- package/vendor/abseil-cpp/absl/strings/internal/escaping.h +2 -26
- package/vendor/abseil-cpp/absl/strings/internal/generic_printer_internal.h +23 -2
- package/vendor/abseil-cpp/absl/strings/internal/generic_printer_test.cc +6 -2
- package/vendor/abseil-cpp/absl/strings/internal/resize_uninitialized.h +31 -24
- package/vendor/abseil-cpp/absl/strings/internal/resize_uninitialized_test.cc +16 -41
- package/vendor/abseil-cpp/absl/strings/internal/stl_type_traits.h +39 -39
- package/vendor/abseil-cpp/absl/strings/internal/str_format/arg.h +14 -22
- package/vendor/abseil-cpp/absl/strings/internal/str_format/bind.h +2 -2
- package/vendor/abseil-cpp/absl/strings/internal/str_format/convert_test.cc +12 -20
- package/vendor/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +510 -307
- package/vendor/abseil-cpp/absl/strings/internal/str_join_internal.h +0 -1
- package/vendor/abseil-cpp/absl/strings/internal/str_split_internal.h +9 -10
- package/vendor/abseil-cpp/absl/strings/internal/string_constant_test.cc +6 -5
- package/vendor/abseil-cpp/absl/strings/internal/stringify_sink.h +12 -0
- package/vendor/abseil-cpp/absl/strings/internal/stringify_stream.h +119 -0
- package/vendor/abseil-cpp/absl/strings/internal/stringify_stream_test.cc +111 -0
- package/vendor/abseil-cpp/absl/strings/numbers.cc +406 -0
- package/vendor/abseil-cpp/absl/strings/numbers.h +4 -0
- package/vendor/abseil-cpp/absl/strings/numbers_test.cc +33 -0
- package/vendor/abseil-cpp/absl/strings/resize_and_overwrite.h +10 -6
- package/vendor/abseil-cpp/absl/strings/str_cat.h +36 -1
- package/vendor/abseil-cpp/absl/strings/str_cat_benchmark.cc +1 -2
- package/vendor/abseil-cpp/absl/strings/str_cat_test.cc +28 -0
- package/vendor/abseil-cpp/absl/strings/str_join_test.cc +4 -4
- package/vendor/abseil-cpp/absl/strings/str_split.h +11 -6
- package/vendor/abseil-cpp/absl/strings/str_split_test.cc +13 -0
- package/vendor/abseil-cpp/absl/strings/substitute.h +2 -2
- package/vendor/abseil-cpp/absl/synchronization/BUILD.bazel +3 -0
- package/vendor/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +21 -0
- package/vendor/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +5 -0
- package/vendor/abseil-cpp/absl/synchronization/mutex.cc +13 -0
- package/vendor/abseil-cpp/absl/synchronization/mutex.h +32 -2
- package/vendor/abseil-cpp/absl/synchronization/mutex_test.cc +17 -3
- package/vendor/abseil-cpp/absl/time/BUILD.bazel +80 -0
- package/vendor/abseil-cpp/absl/time/CMakeLists.txt +73 -0
- package/vendor/abseil-cpp/absl/time/clock.h +3 -0
- package/vendor/abseil-cpp/absl/time/clock_interface.cc +71 -0
- package/vendor/abseil-cpp/absl/time/clock_interface.h +93 -0
- package/vendor/abseil-cpp/absl/time/clock_interface_test.cc +128 -0
- package/vendor/abseil-cpp/absl/time/format.cc +3 -10
- package/vendor/abseil-cpp/absl/time/format_test.cc +12 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +90 -89
- package/vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_format_test.cc +80 -5
- package/vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.cc +1 -2
- package/vendor/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +10 -15
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/version +1 -1
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Vancouver +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Ho_Chi_Minh +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Phnom_Penh +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Saigon +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tbilisi +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Vientiane +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Canada/Pacific +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Chisinau +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Tiraspol +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zone1970.tab +1 -1
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zonenow.tab +3 -3
- package/vendor/abseil-cpp/absl/time/simulated_clock.cc +225 -0
- package/vendor/abseil-cpp/absl/time/simulated_clock.h +109 -0
- package/vendor/abseil-cpp/absl/time/simulated_clock_test.cc +614 -0
- package/vendor/abseil-cpp/absl/types/BUILD.bazel +116 -0
- package/vendor/abseil-cpp/absl/types/CMakeLists.txt +100 -0
- package/vendor/abseil-cpp/absl/types/any.h +26 -4
- package/vendor/abseil-cpp/absl/types/any_span.h +1067 -0
- package/vendor/abseil-cpp/absl/types/any_span_benchmark.cc +258 -0
- package/vendor/abseil-cpp/absl/types/any_span_test.cc +1210 -0
- package/vendor/abseil-cpp/absl/types/compare.h +4 -4
- package/vendor/abseil-cpp/absl/types/internal/any_span.h +477 -0
- package/vendor/abseil-cpp/absl/types/internal/span.h +5 -6
- package/vendor/abseil-cpp/absl/types/optional.h +30 -3
- package/vendor/abseil-cpp/absl/types/optional_ref.h +295 -0
- package/vendor/abseil-cpp/absl/types/optional_ref_test.cc +370 -0
- package/vendor/abseil-cpp/absl/types/source_location.cc +18 -0
- package/vendor/abseil-cpp/absl/types/source_location.h +172 -0
- package/vendor/abseil-cpp/absl/types/source_location_test.cc +139 -0
- package/vendor/abseil-cpp/absl/types/span.h +19 -23
- package/vendor/abseil-cpp/absl/types/variant.h +75 -18
- package/vendor/abseil-cpp/absl/types/variant_test.cc +23 -23
- package/vendor/abseil-cpp/absl/utility/BUILD.bazel +1 -0
- package/vendor/abseil-cpp/absl/utility/CMakeLists.txt +1 -0
- package/vendor/abseil-cpp/absl/utility/utility.h +99 -16
- package/vendor/abseil-cpp/ci/absl_alternate_options.h +2 -0
- package/vendor/abseil-cpp/ci/linux_arm_clang-latest_libcxx_bazel.sh +10 -4
- package/vendor/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh +13 -6
- package/vendor/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh +10 -4
- package/vendor/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh +12 -5
- package/vendor/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh +9 -2
- package/vendor/abseil-cpp/ci/linux_docker_containers.sh +4 -4
- package/vendor/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh +10 -3
- package/vendor/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh +8 -2
- package/vendor/abseil-cpp/ci/macos_xcode_bazel.sh +4 -3
- package/vendor/abseil-cpp/ci/macos_xcode_cmake.sh +2 -2
- package/vendor/abseil-cpp/ci/windows_clangcl_bazel.bat +1 -1
- package/vendor/abseil-cpp/ci/windows_msvc_bazel.bat +1 -1
- package/vendor/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer.cc +0 -118
- package/vendor/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer.h +0 -71
- package/vendor/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer_test.cc +0 -97
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// Copyright 2026 The Abseil Authors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
#include "absl/base/internal/hardening.h"
|
|
16
|
+
|
|
17
|
+
#include <vector>
|
|
18
|
+
|
|
19
|
+
#include "gtest/gtest.h"
|
|
20
|
+
#include "absl/base/macros.h"
|
|
21
|
+
#include "absl/base/options.h"
|
|
22
|
+
|
|
23
|
+
namespace {
|
|
24
|
+
|
|
25
|
+
bool IsHardened() {
|
|
26
|
+
bool hardened = false;
|
|
27
|
+
ABSL_HARDENING_ASSERT([&hardened]() {
|
|
28
|
+
hardened = true;
|
|
29
|
+
return true;
|
|
30
|
+
}()
|
|
31
|
+
);
|
|
32
|
+
return hardened;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
bool IsHardenedSlow() {
|
|
36
|
+
bool hardened = false;
|
|
37
|
+
ABSL_HARDENING_ASSERT_SLOW([&hardened]() {
|
|
38
|
+
hardened = true;
|
|
39
|
+
return true;
|
|
40
|
+
}()
|
|
41
|
+
);
|
|
42
|
+
return hardened;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
TEST(HardeningTest, HardeningAssertSlow) {
|
|
46
|
+
absl::base_internal::HardeningAssertSlow(true);
|
|
47
|
+
if (!IsHardenedSlow()) {
|
|
48
|
+
absl::base_internal::HardeningAssertSlow(false);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
TEST(HardeningDeathTest, HardeningAssertSlow) {
|
|
53
|
+
#if GTEST_HAS_DEATH_TEST
|
|
54
|
+
if (IsHardenedSlow()) {
|
|
55
|
+
// The underlying mechanism of termination varies, and may include SIGILL
|
|
56
|
+
// or SIGABRT.
|
|
57
|
+
EXPECT_DEATH(absl::base_internal::HardeningAssertSlow(false), "");
|
|
58
|
+
}
|
|
59
|
+
#endif
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
TEST(HardeningTest, HardeningAssertGT) {
|
|
63
|
+
absl::base_internal::HardeningAssertGT(1, 0);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
TEST(HardeningDeathTest, HardeningAssertGT) {
|
|
67
|
+
#if GTEST_HAS_DEATH_TEST
|
|
68
|
+
if (IsHardened()) {
|
|
69
|
+
// The underlying mechanism of termination varies, and may include SIGILL
|
|
70
|
+
// or SIGABRT.
|
|
71
|
+
EXPECT_DEATH(absl::base_internal::HardeningAssertGT(1, 1), "");
|
|
72
|
+
EXPECT_DEATH(absl::base_internal::HardeningAssertGT(0, 1), "");
|
|
73
|
+
}
|
|
74
|
+
#endif
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
TEST(HardeningTest, HardeningAssertGE) {
|
|
78
|
+
absl::base_internal::HardeningAssertGE(1, 0);
|
|
79
|
+
absl::base_internal::HardeningAssertGE(1, 1);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
TEST(HardeningDeathTest, HardeningAssertGE) {
|
|
83
|
+
#if GTEST_HAS_DEATH_TEST
|
|
84
|
+
if (IsHardened()) {
|
|
85
|
+
// The underlying mechanism of termination varies, and may include SIGILL
|
|
86
|
+
// or SIGABRT.
|
|
87
|
+
EXPECT_DEATH(absl::base_internal::HardeningAssertGE(0, 1), "");
|
|
88
|
+
}
|
|
89
|
+
#endif
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
TEST(HardeningTest, HardeningAssertLT) {
|
|
93
|
+
absl::base_internal::HardeningAssertLT(0, 1);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
TEST(HardeningDeathTest, HardeningAssertLT) {
|
|
97
|
+
#if GTEST_HAS_DEATH_TEST
|
|
98
|
+
if (IsHardened()) {
|
|
99
|
+
// The underlying mechanism of termination varies, and may include SIGILL
|
|
100
|
+
// or SIGABRT.
|
|
101
|
+
EXPECT_DEATH(absl::base_internal::HardeningAssertLT(1, 1), "");
|
|
102
|
+
EXPECT_DEATH(absl::base_internal::HardeningAssertLT(1, 0), "");
|
|
103
|
+
}
|
|
104
|
+
#endif
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
TEST(HardeningTest, HardeningAssertLE) {
|
|
108
|
+
absl::base_internal::HardeningAssertLE(0, 1);
|
|
109
|
+
absl::base_internal::HardeningAssertLE(1, 1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
TEST(HardeningDeathTest, HardeningAssertLE) {
|
|
113
|
+
#if GTEST_HAS_DEATH_TEST
|
|
114
|
+
if (IsHardened()) {
|
|
115
|
+
// The underlying mechanism of termination varies, and may include SIGILL
|
|
116
|
+
// or SIGABRT.
|
|
117
|
+
EXPECT_DEATH(absl::base_internal::HardeningAssertLE(1, 0), "");
|
|
118
|
+
}
|
|
119
|
+
#endif
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
TEST(HardeningTest, HardeningAssertInBounds) {
|
|
123
|
+
absl::base_internal::HardeningAssertInBounds(0, 10);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
TEST(HardeningDeathTest, HardeningAssertInBounds) {
|
|
127
|
+
#if GTEST_HAS_DEATH_TEST
|
|
128
|
+
if (IsHardened()) {
|
|
129
|
+
// The underlying mechanism of termination varies, and may include SIGILL
|
|
130
|
+
// or SIGABRT.
|
|
131
|
+
EXPECT_DEATH(absl::base_internal::HardeningAssertInBounds(10, 10), "");
|
|
132
|
+
}
|
|
133
|
+
#endif
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
TEST(HardeningTest, HardeningAssertNonEmpty) {
|
|
137
|
+
std::vector<int> v = {1};
|
|
138
|
+
absl::base_internal::HardeningAssertNonEmpty(v);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
TEST(HardeningDeathTest, HardeningAssertNonEmpty) {
|
|
142
|
+
#if GTEST_HAS_DEATH_TEST
|
|
143
|
+
if (IsHardened()) {
|
|
144
|
+
// The underlying mechanism of termination varies, and may include SIGILL
|
|
145
|
+
// or SIGABRT.
|
|
146
|
+
std::vector<int> v = {};
|
|
147
|
+
EXPECT_DEATH(absl::base_internal::HardeningAssertNonEmpty(v), "");
|
|
148
|
+
}
|
|
149
|
+
#endif
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
TEST(HardeningTest, HardeningAssertNonNull) {
|
|
153
|
+
int x = 1;
|
|
154
|
+
absl::base_internal::HardeningAssertNonNull(&x);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
TEST(HardeningDeathTest, HardeningAssertNonNull) {
|
|
158
|
+
#if GTEST_HAS_DEATH_TEST
|
|
159
|
+
if (IsHardened()) {
|
|
160
|
+
// The underlying mechanism of termination varies, and may include SIGILL
|
|
161
|
+
// or SIGABRT.
|
|
162
|
+
int *x = nullptr;
|
|
163
|
+
EXPECT_DEATH(absl::base_internal::HardeningAssertNonNull(x), "");
|
|
164
|
+
}
|
|
165
|
+
#endif
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
} // namespace
|
|
@@ -37,7 +37,7 @@ struct IteratorCategory {};
|
|
|
37
37
|
template <typename Iterator>
|
|
38
38
|
struct IteratorCategory<
|
|
39
39
|
Iterator,
|
|
40
|
-
|
|
40
|
+
std::void_t<typename std::iterator_traits<Iterator>::iterator_category>> {
|
|
41
41
|
using type = typename std::iterator_traits<Iterator>::iterator_category;
|
|
42
42
|
};
|
|
43
43
|
|
|
@@ -47,7 +47,7 @@ struct IteratorConceptImpl : IteratorCategory<Iterator> {};
|
|
|
47
47
|
template <typename Iterator>
|
|
48
48
|
struct IteratorConceptImpl<
|
|
49
49
|
Iterator,
|
|
50
|
-
|
|
50
|
+
std::void_t<typename std::iterator_traits<Iterator>::iterator_concept>> {
|
|
51
51
|
using type = typename std::iterator_traits<Iterator>::iterator_concept;
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -18,8 +18,11 @@
|
|
|
18
18
|
#ifndef ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_
|
|
19
19
|
#define ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_
|
|
20
20
|
|
|
21
|
+
#include <atomic>
|
|
22
|
+
|
|
21
23
|
#include "absl/base/internal/raw_logging.h"
|
|
22
24
|
#include "absl/base/internal/scheduling_mode.h"
|
|
25
|
+
#include "absl/base/internal/thread_identity.h"
|
|
23
26
|
#include "absl/base/macros.h"
|
|
24
27
|
|
|
25
28
|
// The following two declarations exist so SchedulingGuard may friend them with
|
|
@@ -64,7 +67,6 @@ class SchedulingGuard {
|
|
|
64
67
|
SchedulingGuard(const SchedulingGuard&) = delete;
|
|
65
68
|
SchedulingGuard& operator=(const SchedulingGuard&) = delete;
|
|
66
69
|
|
|
67
|
-
private:
|
|
68
70
|
// Disable cooperative rescheduling of the calling thread. It may still
|
|
69
71
|
// initiate scheduling operations (e.g. wake-ups), however, it may not itself
|
|
70
72
|
// reschedule. Nestable. The returned result is opaque, clients should not
|
|
@@ -96,13 +98,6 @@ class SchedulingGuard {
|
|
|
96
98
|
private:
|
|
97
99
|
int scheduling_disabled_depth_;
|
|
98
100
|
};
|
|
99
|
-
|
|
100
|
-
// Access to SchedulingGuard is explicitly permitted.
|
|
101
|
-
friend class absl::CondVar;
|
|
102
|
-
friend class absl::Mutex;
|
|
103
|
-
friend class SchedulingHelper;
|
|
104
|
-
friend class SpinLock;
|
|
105
|
-
friend int absl::synchronization_internal::MutexDelay(int32_t c, int mode);
|
|
106
101
|
};
|
|
107
102
|
|
|
108
103
|
//------------------------------------------------------------------------------
|
|
@@ -110,21 +105,88 @@ class SchedulingGuard {
|
|
|
110
105
|
//------------------------------------------------------------------------------
|
|
111
106
|
|
|
112
107
|
inline bool SchedulingGuard::ReschedulingIsAllowed() {
|
|
113
|
-
|
|
108
|
+
ThreadIdentity* identity = CurrentThreadIdentityIfPresent();
|
|
109
|
+
if (identity != nullptr) {
|
|
110
|
+
ThreadIdentity::SchedulerState* state = &identity->scheduler_state;
|
|
111
|
+
// For a thread to be eligible for re-scheduling it must have a bound
|
|
112
|
+
// schedulable (otherwise it's not cooperative) and not be within a
|
|
113
|
+
// SchedulerGuard region.
|
|
114
|
+
return state->bound_schedulable.load(std::memory_order_relaxed) !=
|
|
115
|
+
nullptr &&
|
|
116
|
+
state->scheduling_disabled_depth.load(std::memory_order_relaxed) ==
|
|
117
|
+
0;
|
|
118
|
+
} else {
|
|
119
|
+
// Cooperative threads always have a ThreadIdentity.
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
114
122
|
}
|
|
115
123
|
|
|
124
|
+
// We don't use [[nodiscard]] here as some clients (e.g.
|
|
125
|
+
// FinishPotentiallyBlockingRegion()) cannot yet properly consume it.
|
|
116
126
|
inline bool SchedulingGuard::DisableRescheduling() {
|
|
117
|
-
|
|
127
|
+
ThreadIdentity* identity;
|
|
128
|
+
identity = CurrentThreadIdentityIfPresent();
|
|
129
|
+
if (identity != nullptr) {
|
|
130
|
+
// The depth is accessed concurrently from other threads, so it must be
|
|
131
|
+
// atomic, but it's only mutated from this thread, so we don't need an
|
|
132
|
+
// atomic increment.
|
|
133
|
+
int old_val = identity->scheduler_state.scheduling_disabled_depth.load(
|
|
134
|
+
std::memory_order_relaxed);
|
|
135
|
+
identity->scheduler_state.scheduling_disabled_depth.store(
|
|
136
|
+
old_val + 1, std::memory_order_relaxed);
|
|
137
|
+
return true;
|
|
138
|
+
} else {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
inline void SchedulingGuard::EnableRescheduling(bool disable_result) {
|
|
144
|
+
if (!disable_result) {
|
|
145
|
+
// There was no installed thread identity at the time that scheduling was
|
|
146
|
+
// disabled, so we have nothing to do. This is an implementation detail
|
|
147
|
+
// that may change in the future, clients may not depend on it.
|
|
148
|
+
// EnableRescheduling() must always be called.
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
ThreadIdentity* identity;
|
|
153
|
+
// A thread identity exists, see above
|
|
154
|
+
identity = CurrentThreadIdentityIfPresent();
|
|
155
|
+
// The depth is accessed concurrently from other threads, so it must be
|
|
156
|
+
// atomic, but it's only mutated from this thread, so we don't need an atomic
|
|
157
|
+
// decrement.
|
|
158
|
+
int old_val = identity->scheduler_state.scheduling_disabled_depth.load(
|
|
159
|
+
std::memory_order_relaxed);
|
|
160
|
+
identity->scheduler_state.scheduling_disabled_depth.store(
|
|
161
|
+
old_val - 1, std::memory_order_relaxed);
|
|
118
162
|
}
|
|
119
163
|
|
|
120
|
-
inline
|
|
121
|
-
|
|
164
|
+
inline SchedulingGuard::ScopedEnable::ScopedEnable() {
|
|
165
|
+
ThreadIdentity* identity;
|
|
166
|
+
identity = CurrentThreadIdentityIfPresent();
|
|
167
|
+
if (identity != nullptr) {
|
|
168
|
+
scheduling_disabled_depth_ =
|
|
169
|
+
identity->scheduler_state.scheduling_disabled_depth.load(
|
|
170
|
+
std::memory_order_relaxed);
|
|
171
|
+
if (scheduling_disabled_depth_ != 0) {
|
|
172
|
+
// The store below does not need to be compare_exchange because
|
|
173
|
+
// the value is never modified concurrently (only accessed).
|
|
174
|
+
identity->scheduler_state.scheduling_disabled_depth.store(
|
|
175
|
+
0, std::memory_order_relaxed);
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
scheduling_disabled_depth_ = 0;
|
|
179
|
+
}
|
|
122
180
|
}
|
|
123
181
|
|
|
124
|
-
inline SchedulingGuard::ScopedEnable::ScopedEnable()
|
|
125
|
-
: scheduling_disabled_depth_(0) {}
|
|
126
182
|
inline SchedulingGuard::ScopedEnable::~ScopedEnable() {
|
|
127
|
-
|
|
183
|
+
if (scheduling_disabled_depth_ == 0) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
ThreadIdentity* identity = CurrentThreadIdentityIfPresent();
|
|
187
|
+
// itentity is guaranteed to exist, see the constructor above.
|
|
188
|
+
identity->scheduler_state.scheduling_disabled_depth.store(
|
|
189
|
+
scheduling_disabled_depth_, std::memory_order_relaxed);
|
|
128
190
|
}
|
|
129
191
|
|
|
130
192
|
} // namespace base_internal
|
|
@@ -244,8 +244,7 @@ static int64_t ReadMonotonicClockNanos() {
|
|
|
244
244
|
int rc = clock_gettime(CLOCK_MONOTONIC, &t);
|
|
245
245
|
#endif
|
|
246
246
|
if (rc != 0) {
|
|
247
|
-
|
|
248
|
-
FATAL, "clock_gettime() failed: (" + std::to_string(errno) + ")");
|
|
247
|
+
ABSL_RAW_LOG(FATAL, "clock_gettime() failed: (%d)", errno);
|
|
249
248
|
}
|
|
250
249
|
return int64_t{t.tv_sec} * 1000000000 + t.tv_nsec;
|
|
251
250
|
}
|
|
@@ -146,6 +146,54 @@ struct ThreadIdentity {
|
|
|
146
146
|
// ThreadIdentity itself.
|
|
147
147
|
PerThreadSynch per_thread_synch;
|
|
148
148
|
|
|
149
|
+
struct SchedulerState {
|
|
150
|
+
std::atomic<void*> bound_schedulable{nullptr};
|
|
151
|
+
// Storage space for a SpinLock, which is created through a placement new to
|
|
152
|
+
// break a dependency cycle.
|
|
153
|
+
uint32_t association_lock_word;
|
|
154
|
+
std::atomic<int> scheduling_disabled_depth;
|
|
155
|
+
int potentially_blocking_depth;
|
|
156
|
+
uint32_t schedule_next_state;
|
|
157
|
+
|
|
158
|
+
// When true, current thread is unlocking a mutex and actively waking a
|
|
159
|
+
// thread that was previously waiting, but that lock has yet more waiters.
|
|
160
|
+
// Used to signal to schedulers that work being woken should get an
|
|
161
|
+
// elevated priority.
|
|
162
|
+
bool waking_designated_waker;
|
|
163
|
+
|
|
164
|
+
inline SpinLock* association_lock() {
|
|
165
|
+
return reinterpret_cast<SpinLock*>(&association_lock_word);
|
|
166
|
+
}
|
|
167
|
+
} scheduler_state; // Private: Reserved for use in Gloop
|
|
168
|
+
|
|
169
|
+
// For worker threads that may not be doing any interesting user work, this
|
|
170
|
+
// tracks the current state of the worker. This is used to handle those
|
|
171
|
+
// threads differently e.g. when printing stacktraces.
|
|
172
|
+
//
|
|
173
|
+
// It should only be written to by the thread itself.
|
|
174
|
+
//
|
|
175
|
+
// Note that this is different from the mutex idle bit - threads running user
|
|
176
|
+
// work can be waiting but still be active.
|
|
177
|
+
//
|
|
178
|
+
// Note: not all parts of the code-base may maintain this field correctly and
|
|
179
|
+
// therefore this field should only be used to improve debugging/monitoring.
|
|
180
|
+
//
|
|
181
|
+
// Put it here to reuse some of the padding space.
|
|
182
|
+
enum class WaitState : uint8_t {
|
|
183
|
+
kActive = 0,
|
|
184
|
+
kWaitingForWork = 1,
|
|
185
|
+
};
|
|
186
|
+
std::atomic<WaitState> wait_state;
|
|
187
|
+
static_assert(std::atomic<WaitState>::is_always_lock_free);
|
|
188
|
+
|
|
189
|
+
// Add a padding such that scheduler_state is on a different cache line than
|
|
190
|
+
// waiter state. We use padding here, so that the size of the structure does
|
|
191
|
+
// not substantially grow due to the added padding.
|
|
192
|
+
static constexpr size_t kToBePaddedSize =
|
|
193
|
+
sizeof(SchedulerState) + sizeof(std::atomic<WaitState>);
|
|
194
|
+
static_assert(ABSL_CACHELINE_SIZE >= kToBePaddedSize);
|
|
195
|
+
char padding[ABSL_CACHELINE_SIZE - kToBePaddedSize];
|
|
196
|
+
|
|
149
197
|
// Private: Reserved for absl::synchronization_internal::Waiter.
|
|
150
198
|
struct WaiterState {
|
|
151
199
|
alignas(void*) char data[256];
|
|
@@ -161,6 +209,10 @@ struct ThreadIdentity {
|
|
|
161
209
|
std::atomic<int> wait_start; // Ticker value when thread started waiting.
|
|
162
210
|
std::atomic<bool> is_idle; // Has thread become idle yet?
|
|
163
211
|
|
|
212
|
+
// For tracking depth of __cxa_guard_acquire. This used to recognize heap
|
|
213
|
+
// allocations for function static objects.
|
|
214
|
+
int static_initialization_depth;
|
|
215
|
+
|
|
164
216
|
ThreadIdentity* next;
|
|
165
217
|
};
|
|
166
218
|
|
|
@@ -47,6 +47,10 @@
|
|
|
47
47
|
|
|
48
48
|
#if ABSL_USE_UNSCALED_CYCLECLOCK
|
|
49
49
|
|
|
50
|
+
namespace gloop_do_not_use {
|
|
51
|
+
class UnscaledCycleClockWrapperForPerCpuTest;
|
|
52
|
+
} // namespace gloop_do_not_use
|
|
53
|
+
|
|
50
54
|
namespace absl {
|
|
51
55
|
ABSL_NAMESPACE_BEGIN
|
|
52
56
|
namespace time_internal {
|
|
@@ -75,6 +79,7 @@ class UnscaledCycleClock {
|
|
|
75
79
|
friend class base_internal::CycleClock;
|
|
76
80
|
friend class time_internal::UnscaledCycleClockWrapperForGetCurrentTime;
|
|
77
81
|
friend class base_internal::UnscaledCycleClockWrapperForInitializeFrequency;
|
|
82
|
+
friend class gloop_do_not_use::UnscaledCycleClockWrapperForPerCpuTest;
|
|
78
83
|
};
|
|
79
84
|
|
|
80
85
|
#if defined(__x86_64__)
|
|
@@ -53,9 +53,40 @@ namespace macros_internal {
|
|
|
53
53
|
template <typename T, size_t N>
|
|
54
54
|
auto ArraySizeHelper(const T (&array)[N]) -> char (&)[N];
|
|
55
55
|
} // namespace macros_internal
|
|
56
|
+
|
|
57
|
+
namespace base_internal {
|
|
58
|
+
#if ABSL_HAVE_CPP_ATTRIBUTE(clang::nomerge)
|
|
59
|
+
[[clang::nomerge]] // Needed when this function is not inlined
|
|
60
|
+
#endif
|
|
61
|
+
[[noreturn]] inline void HardeningAbort() {
|
|
62
|
+
#if ABSL_HAVE_CPP_ATTRIBUTE(clang::nomerge)
|
|
63
|
+
[[clang::nomerge]] // Needed when this function is inlined
|
|
64
|
+
#endif
|
|
65
|
+
ABSL_INTERNAL_IMMEDIATE_ABORT_IMPL();
|
|
66
|
+
ABSL_INTERNAL_UNREACHABLE_IMPL();
|
|
67
|
+
}
|
|
68
|
+
} // namespace base_internal
|
|
56
69
|
ABSL_NAMESPACE_END
|
|
57
70
|
} // namespace absl
|
|
58
71
|
|
|
72
|
+
// ABSL_INTERNAL_UNEVALUATED()
|
|
73
|
+
//
|
|
74
|
+
// Expands into a no-op expression that contains the given expression. Used to
|
|
75
|
+
// avoid unused-variable warnings in configurations that don't need to evaluate
|
|
76
|
+
// the given expression (e.g., NDEBUG).
|
|
77
|
+
#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L
|
|
78
|
+
// We use `decltype` here to avoid generating unnecessary code that the
|
|
79
|
+
// optimizer then has to optimize away.
|
|
80
|
+
// This not only improves compilation performance by reducing codegen bloat
|
|
81
|
+
// and optimization work, but also guarantees fast run-time performance without
|
|
82
|
+
// having to rely on the optimizer.
|
|
83
|
+
#define ABSL_INTERNAL_UNEVALUATED(expr) (decltype((void)(expr))())
|
|
84
|
+
#else
|
|
85
|
+
// Pre-C++20, lambdas can't be inside unevaluated operands, so we're forced to
|
|
86
|
+
// rely on the optimizer.
|
|
87
|
+
#define ABSL_INTERNAL_UNEVALUATED(expr) (false ? (void)(expr) : void())
|
|
88
|
+
#endif
|
|
89
|
+
|
|
59
90
|
// ABSL_BAD_CALL_IF()
|
|
60
91
|
//
|
|
61
92
|
// Used on a function overload to trap bad calls: any call that matches the
|
|
@@ -93,33 +124,18 @@ ABSL_NAMESPACE_END
|
|
|
93
124
|
// This macro is inspired by
|
|
94
125
|
// https://akrzemi1.wordpress.com/2017/05/18/asserts-in-constexpr-functions/
|
|
95
126
|
#if defined(NDEBUG)
|
|
96
|
-
#
|
|
97
|
-
// We use `decltype` here to avoid generating unnecessary code that the
|
|
98
|
-
// optimizer then has to optimize away.
|
|
99
|
-
// This not only improves compilation performance by reducing codegen bloat
|
|
100
|
-
// and optimization work, but also guarantees fast run-time performance without
|
|
101
|
-
// having to rely on the optimizer.
|
|
102
|
-
#define ABSL_ASSERT(expr) (decltype((expr) ? void() : void())())
|
|
103
|
-
#else
|
|
104
|
-
// Pre-C++20, lambdas can't be inside unevaluated operands, so we're forced to
|
|
105
|
-
// rely on the optimizer.
|
|
106
|
-
#define ABSL_ASSERT(expr) (false ? ((expr) ? void() : void()) : void())
|
|
107
|
-
#endif
|
|
127
|
+
#define ABSL_ASSERT(expr) ABSL_INTERNAL_UNEVALUATED((expr) ? void() : void())
|
|
108
128
|
#else
|
|
109
129
|
#define ABSL_ASSERT(expr) \
|
|
110
130
|
(ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \
|
|
111
|
-
:
|
|
131
|
+
: assert(false && #expr)) // NOLINT
|
|
112
132
|
#endif
|
|
113
133
|
|
|
114
134
|
// `ABSL_INTERNAL_HARDENING_ABORT()` controls how `ABSL_HARDENING_ASSERT()`
|
|
115
135
|
// aborts the program in release mode (when NDEBUG is defined). The
|
|
116
136
|
// implementation should abort the program as quickly as possible and ideally it
|
|
117
137
|
// should not be possible to ignore the abort request.
|
|
118
|
-
#define ABSL_INTERNAL_HARDENING_ABORT()
|
|
119
|
-
do { \
|
|
120
|
-
ABSL_INTERNAL_IMMEDIATE_ABORT_IMPL(); \
|
|
121
|
-
ABSL_INTERNAL_UNREACHABLE_IMPL(); \
|
|
122
|
-
} while (false)
|
|
138
|
+
#define ABSL_INTERNAL_HARDENING_ABORT() ::absl::base_internal::HardeningAbort()
|
|
123
139
|
|
|
124
140
|
// ABSL_HARDENING_ASSERT()
|
|
125
141
|
//
|
|
@@ -135,7 +151,7 @@ ABSL_NAMESPACE_END
|
|
|
135
151
|
#if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
|
|
136
152
|
#define ABSL_HARDENING_ASSERT(expr) \
|
|
137
153
|
(ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \
|
|
138
|
-
:
|
|
154
|
+
: ABSL_INTERNAL_HARDENING_ABORT())
|
|
139
155
|
#else
|
|
140
156
|
#define ABSL_HARDENING_ASSERT(expr) ABSL_ASSERT(expr)
|
|
141
157
|
#endif
|
|
@@ -154,7 +170,7 @@ ABSL_NAMESPACE_END
|
|
|
154
170
|
#if ABSL_OPTION_HARDENED == 1 && defined(NDEBUG)
|
|
155
171
|
#define ABSL_HARDENING_ASSERT_SLOW(expr) \
|
|
156
172
|
(ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \
|
|
157
|
-
:
|
|
173
|
+
: ABSL_INTERNAL_HARDENING_ABORT())
|
|
158
174
|
#else
|
|
159
175
|
#define ABSL_HARDENING_ASSERT_SLOW(expr) ABSL_ASSERT(expr)
|
|
160
176
|
#endif
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
// // describes is preferred, unless inconsistent with surrounding code.
|
|
96
96
|
// absl_nonnull std::unique_ptr<Employee> employee;
|
|
97
97
|
//
|
|
98
|
-
// // Invalid annotation usage
|
|
98
|
+
// // Invalid annotation usage - this attempts to declare a pointer to a
|
|
99
99
|
// // nullable `Employee`, which is meaningless.
|
|
100
100
|
// absl_nullable Employee* e;
|
|
101
101
|
//
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
//
|
|
131
131
|
// // CompleteTransaction() guarantees the returned pointer to an `Account` to
|
|
132
132
|
// // be non-null.
|
|
133
|
-
// Account* absl_nonnull
|
|
133
|
+
// Account* absl_nonnull CompleteTransaction(double fee) {
|
|
134
134
|
// ...
|
|
135
135
|
// }
|
|
136
136
|
//
|
|
@@ -180,6 +180,7 @@
|
|
|
180
180
|
// `absl_nonnull` is *not guaranteed* to be non-null, and the compiler won't
|
|
181
181
|
// alert or prevent assignment of a `T* absl_nullable` to a `T* absl_nonnull`.
|
|
182
182
|
// ===========================================================================
|
|
183
|
+
// SKIP_ABSL_INLINE_NAMESPACE_CHECK
|
|
183
184
|
#ifndef ABSL_BASE_NULLABILITY_H_
|
|
184
185
|
#define ABSL_BASE_NULLABILITY_H_
|
|
185
186
|
|
|
@@ -203,7 +204,7 @@
|
|
|
203
204
|
// T* absl_nullable GetNullablePtr(); // explicitly nullable
|
|
204
205
|
// T* absl_nullability_unknown GetUnknownPtr(); // explicitly unknown
|
|
205
206
|
//
|
|
206
|
-
// The macro can be safely used in header files
|
|
207
|
+
// The macro can be safely used in header files - it will not affect any files
|
|
207
208
|
// that include it.
|
|
208
209
|
//
|
|
209
210
|
// In files with the macro, plain `T*` syntax means `T* absl_nonnull`, and the
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
#define ABSL_BASE_OPTIMIZATION_H_
|
|
32
32
|
|
|
33
33
|
#include <assert.h>
|
|
34
|
+
#include <stdlib.h>
|
|
34
35
|
|
|
35
36
|
#ifdef __cplusplus
|
|
36
37
|
// Included for std::unreachable()
|
|
@@ -217,12 +218,12 @@
|
|
|
217
218
|
#elif defined(_MSC_VER)
|
|
218
219
|
#define ABSL_INTERNAL_UNREACHABLE_IMPL() __assume(false)
|
|
219
220
|
#else
|
|
220
|
-
#define ABSL_INTERNAL_UNREACHABLE_IMPL()
|
|
221
|
+
#define ABSL_INTERNAL_UNREACHABLE_IMPL() ((void)0)
|
|
221
222
|
#endif
|
|
222
223
|
|
|
223
224
|
// `ABSL_UNREACHABLE()` is an unreachable statement. A program which reaches
|
|
224
225
|
// one has undefined behavior, and the compiler may optimize accordingly.
|
|
225
|
-
#if ABSL_OPTION_HARDENED == 1 && defined(NDEBUG)
|
|
226
|
+
#if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
|
|
226
227
|
// Abort in hardened mode to avoid dangerous undefined behavior.
|
|
227
228
|
#define ABSL_UNREACHABLE() \
|
|
228
229
|
do { \
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
#include "absl/base/optimization.h"
|
|
16
16
|
|
|
17
|
+
#include <optional>
|
|
18
|
+
|
|
17
19
|
#include "gtest/gtest.h"
|
|
18
|
-
#include "absl/types/optional.h"
|
|
19
20
|
|
|
20
21
|
namespace {
|
|
21
22
|
|
|
@@ -80,8 +81,8 @@ TEST(PredictTest, Pointer) {
|
|
|
80
81
|
|
|
81
82
|
TEST(PredictTest, Optional) {
|
|
82
83
|
// Note: An optional's truth value is the value's existence, not its truth.
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
std::optional<bool> has_value(false);
|
|
85
|
+
std::optional<bool> no_value;
|
|
85
86
|
EXPECT_TRUE(ABSL_PREDICT_TRUE(has_value));
|
|
86
87
|
EXPECT_FALSE(ABSL_PREDICT_TRUE(no_value));
|
|
87
88
|
EXPECT_TRUE(ABSL_PREDICT_FALSE(has_value));
|
|
@@ -73,6 +73,34 @@
|
|
|
73
73
|
// Type Compatibility Options
|
|
74
74
|
// -----------------------------------------------------------------------------
|
|
75
75
|
|
|
76
|
+
// ABSL_OPTION_USE_STD_SOURCE_LOCATION
|
|
77
|
+
//
|
|
78
|
+
// This option controls whether absl::SourceLocation is implemented as an alias
|
|
79
|
+
// to the std::source_location type, or as an independent implementation.
|
|
80
|
+
//
|
|
81
|
+
// A value of 0 means to use Abseil's implementation. This requires only C++17
|
|
82
|
+
// support, and is expected to run on every toolchain we support, and to
|
|
83
|
+
// properly capture source location information on every toolchain that supports
|
|
84
|
+
// the necessary built-ins (such as `__builtin_LINE`).
|
|
85
|
+
//
|
|
86
|
+
// A value of 1 means to use aliases. This requires that all code using Abseil
|
|
87
|
+
// is built in C++20 mode or later.
|
|
88
|
+
//
|
|
89
|
+
// A value of 2 means to detect the C++ version being used to compile Abseil,
|
|
90
|
+
// and use an alias only if working std::source_location types are available.
|
|
91
|
+
// This option is useful when you are building your program from source. It
|
|
92
|
+
// should not be used otherwise -- for example, if you are distributing Abseil
|
|
93
|
+
// in a binary package manager -- since in mode 2, they will name different
|
|
94
|
+
// types, with different mangled names and binary layout, depending on the
|
|
95
|
+
// compiler flags passed by the end user. For more info, see
|
|
96
|
+
// https://abseil.io/about/design/dropin-types.
|
|
97
|
+
//
|
|
98
|
+
// User code should not inspect this macro. To check in the preprocessor if
|
|
99
|
+
// the source location type is an alias of std::source_location type, use the
|
|
100
|
+
// feature macro ABSL_USES_STD_SOURCE_LOCATION.
|
|
101
|
+
//
|
|
102
|
+
#define ABSL_OPTION_USE_STD_SOURCE_LOCATION 2
|
|
103
|
+
|
|
76
104
|
// ABSL_OPTION_USE_STD_ORDERING
|
|
77
105
|
//
|
|
78
106
|
// This option controls whether absl::{partial,weak,strong}_ordering are
|
|
@@ -123,7 +151,7 @@
|
|
|
123
151
|
// allowed.
|
|
124
152
|
|
|
125
153
|
#define ABSL_OPTION_USE_INLINE_NAMESPACE 1
|
|
126
|
-
#define ABSL_OPTION_INLINE_NAMESPACE_NAME
|
|
154
|
+
#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20260526
|
|
127
155
|
|
|
128
156
|
// ABSL_OPTION_HARDENED
|
|
129
157
|
//
|
|
@@ -155,4 +183,30 @@
|
|
|
155
183
|
|
|
156
184
|
#define ABSL_OPTION_HARDENED 0
|
|
157
185
|
|
|
186
|
+
// ABSL_OPTION_INLINE_HW_ACCEL_STRATEGY
|
|
187
|
+
//
|
|
188
|
+
// This option controls whether Abseil is allowed to use non-portable
|
|
189
|
+
// hardware-accelerated implementations in headers (where they are typically
|
|
190
|
+
// inlined into the caller's translation unit).
|
|
191
|
+
//
|
|
192
|
+
// Using such optimizations in headers can lead to One Definition Rule (ODR)
|
|
193
|
+
// violations if different translation units are built with different CPU
|
|
194
|
+
// architecture flags (e.g., -march=native vs -march=generic) and linked
|
|
195
|
+
// together.
|
|
196
|
+
//
|
|
197
|
+
// A value of 0 means to use the portable software implementation in headers.
|
|
198
|
+
// This provides the best ODR guarantees when linking code built with
|
|
199
|
+
// inconsistent flags, but may be slower.
|
|
200
|
+
//
|
|
201
|
+
// A value of 1 means that the implementation requires the use of a
|
|
202
|
+
// hardware-accelerated implementation. This requires the compiler environment
|
|
203
|
+
// to support these instructions; otherwise, the build will fail.
|
|
204
|
+
//
|
|
205
|
+
// A value of 2 means to select the best available implementation based on
|
|
206
|
+
// the compiler flags, but can't guarantee ODR safety if translation units are
|
|
207
|
+
// built with inconsistent flags.
|
|
208
|
+
//
|
|
209
|
+
// User code should not inspect this macro.
|
|
210
|
+
#define ABSL_OPTION_INLINE_HW_ACCEL_STRATEGY 0
|
|
211
|
+
|
|
158
212
|
#endif // ABSL_BASE_OPTIONS_H_
|