re2 1.23.0 → 1.23.2
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/README.md +2 -0
- package/binding.gyp +3 -2
- package/package.json +5 -5
- package/vendor/abseil-cpp/CMake/AbseilDll.cmake +25 -4
- package/vendor/abseil-cpp/CMake/AbseilHelpers.cmake +6 -1
- package/vendor/abseil-cpp/CMakeLists.txt +2 -2
- package/vendor/abseil-cpp/MODULE.bazel +2 -2
- package/vendor/abseil-cpp/absl/algorithm/BUILD.bazel +0 -1
- package/vendor/abseil-cpp/absl/algorithm/CMakeLists.txt +0 -2
- package/vendor/abseil-cpp/absl/algorithm/container.h +191 -140
- package/vendor/abseil-cpp/absl/algorithm/container_test.cc +818 -0
- package/vendor/abseil-cpp/absl/base/BUILD.bazel +44 -5
- package/vendor/abseil-cpp/absl/base/CMakeLists.txt +42 -3
- package/vendor/abseil-cpp/absl/base/attributes.h +5 -1
- package/vendor/abseil-cpp/absl/base/call_once_test.cc +10 -10
- package/vendor/abseil-cpp/absl/base/casts.cc +61 -0
- package/vendor/abseil-cpp/absl/base/casts.h +128 -2
- package/vendor/abseil-cpp/absl/base/casts_test.cc +151 -0
- package/vendor/abseil-cpp/absl/base/config.h +13 -37
- package/vendor/abseil-cpp/absl/base/internal/dynamic_annotations.h +1 -1
- package/vendor/abseil-cpp/absl/base/internal/iterator_traits.h +4 -0
- package/vendor/abseil-cpp/absl/base/internal/nullability_traits.h +71 -0
- package/vendor/abseil-cpp/absl/base/internal/nullability_traits_test.cc +98 -0
- package/vendor/abseil-cpp/absl/base/internal/raw_logging.cc +3 -4
- package/vendor/abseil-cpp/absl/base/internal/spinlock.cc +13 -7
- package/vendor/abseil-cpp/absl/base/internal/spinlock.h +16 -11
- package/vendor/abseil-cpp/absl/base/internal/strerror_test.cc +2 -1
- package/vendor/abseil-cpp/absl/base/internal/sysinfo.cc +0 -9
- package/vendor/abseil-cpp/absl/base/internal/sysinfo_test.cc +0 -6
- package/vendor/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +1 -1
- package/vendor/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +1 -1
- package/vendor/abseil-cpp/absl/base/macros.h +40 -17
- package/vendor/abseil-cpp/absl/base/nullability.h +1 -1
- package/vendor/abseil-cpp/absl/base/optimization.h +1 -3
- package/vendor/abseil-cpp/absl/base/options.h +1 -27
- package/vendor/abseil-cpp/absl/base/spinlock_test_common.cc +5 -8
- package/vendor/abseil-cpp/absl/cleanup/cleanup.h +4 -0
- package/vendor/abseil-cpp/absl/container/BUILD.bazel +195 -2
- package/vendor/abseil-cpp/absl/container/CMakeLists.txt +136 -2
- package/vendor/abseil-cpp/absl/container/btree_map.h +56 -6
- package/vendor/abseil-cpp/absl/container/btree_set.h +52 -6
- package/vendor/abseil-cpp/absl/container/btree_test.cc +107 -1
- package/vendor/abseil-cpp/absl/container/chunked_queue.h +755 -0
- package/vendor/abseil-cpp/absl/container/chunked_queue_benchmark.cc +386 -0
- package/vendor/abseil-cpp/absl/container/chunked_queue_test.cc +768 -0
- package/vendor/abseil-cpp/absl/container/fixed_array.h +4 -6
- package/vendor/abseil-cpp/absl/container/flat_hash_map.h +16 -6
- package/vendor/abseil-cpp/absl/container/flat_hash_map_test.cc +1 -2
- package/vendor/abseil-cpp/absl/container/flat_hash_set.h +16 -6
- package/vendor/abseil-cpp/absl/container/flat_hash_set_test.cc +0 -2
- package/vendor/abseil-cpp/absl/container/inlined_vector.h +12 -4
- package/vendor/abseil-cpp/absl/container/inlined_vector_test.cc +21 -0
- package/vendor/abseil-cpp/absl/container/internal/btree_container.h +14 -5
- package/vendor/abseil-cpp/absl/container/internal/chunked_queue.h +173 -0
- package/vendor/abseil-cpp/absl/container/internal/common.h +51 -0
- package/vendor/abseil-cpp/absl/container/internal/container_memory.h +7 -1
- package/vendor/abseil-cpp/absl/container/internal/container_memory_test.cc +11 -0
- package/vendor/abseil-cpp/absl/container/internal/hash_generator_testing.cc +0 -2
- package/vendor/abseil-cpp/absl/container/internal/hash_generator_testing.h +1 -2
- package/vendor/abseil-cpp/absl/container/internal/hash_policy_testing.h +0 -14
- package/vendor/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +11 -8
- package/vendor/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +3 -4
- package/vendor/abseil-cpp/absl/container/internal/hashtablez_sampler.h +23 -6
- package/vendor/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc +31 -15
- package/vendor/abseil-cpp/absl/container/internal/heterogeneous_lookup_testing.h +80 -0
- package/vendor/abseil-cpp/absl/container/internal/inlined_vector.h +4 -12
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_map.h +35 -10
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set.cc +149 -23
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set.h +120 -126
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set_allocator_test.cc +4 -0
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc +8 -0
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set_probe_benchmark.cc +14 -59
- package/vendor/abseil-cpp/absl/container/internal/raw_hash_set_test.cc +111 -22
- package/vendor/abseil-cpp/absl/container/internal/unordered_map_constructor_test.h +53 -112
- package/vendor/abseil-cpp/absl/container/internal/unordered_map_lookup_test.h +10 -15
- package/vendor/abseil-cpp/absl/container/internal/unordered_map_members_test.h +3 -3
- package/vendor/abseil-cpp/absl/container/internal/unordered_map_modifiers_test.h +45 -61
- package/vendor/abseil-cpp/absl/container/internal/unordered_set_constructor_test.h +53 -112
- package/vendor/abseil-cpp/absl/container/internal/unordered_set_lookup_test.h +6 -9
- package/vendor/abseil-cpp/absl/container/internal/unordered_set_members_test.h +3 -3
- package/vendor/abseil-cpp/absl/container/internal/unordered_set_modifiers_test.h +25 -31
- package/vendor/abseil-cpp/absl/container/linked_hash_map.h +666 -0
- package/vendor/abseil-cpp/absl/container/linked_hash_map_benchmark.cc +140 -0
- package/vendor/abseil-cpp/absl/container/linked_hash_map_test.cc +987 -0
- package/vendor/abseil-cpp/absl/container/linked_hash_set.h +527 -0
- package/vendor/abseil-cpp/absl/container/linked_hash_set_benchmark.cc +84 -0
- package/vendor/abseil-cpp/absl/container/linked_hash_set_test.cc +947 -0
- package/vendor/abseil-cpp/absl/container/node_hash_map.h +17 -6
- package/vendor/abseil-cpp/absl/container/node_hash_set.h +16 -5
- package/vendor/abseil-cpp/absl/container/node_hash_set_test.cc +1 -2
- package/vendor/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake +79 -0
- package/vendor/abseil-cpp/absl/copts/GENERATED_copts.bzl +79 -0
- package/vendor/abseil-cpp/absl/copts/copts.py +17 -4
- package/vendor/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +67 -13
- package/vendor/abseil-cpp/absl/crc/internal/non_temporal_arm_intrinsics.h +4 -2
- package/vendor/abseil-cpp/absl/debugging/BUILD.bazel +31 -0
- package/vendor/abseil-cpp/absl/debugging/CMakeLists.txt +34 -0
- package/vendor/abseil-cpp/absl/debugging/failure_signal_handler.cc +2 -2
- package/vendor/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer.cc +118 -0
- package/vendor/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer.h +71 -0
- package/vendor/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer_test.cc +97 -0
- package/vendor/abseil-cpp/absl/debugging/internal/demangle.cc +2 -2
- package/vendor/abseil-cpp/absl/debugging/internal/elf_mem_image.h +4 -4
- package/vendor/abseil-cpp/absl/debugging/internal/examine_stack.cc +4 -0
- package/vendor/abseil-cpp/absl/debugging/internal/examine_stack.h +7 -0
- package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +1 -1
- package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +0 -7
- package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +3 -2
- package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +2 -1
- package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +8 -3
- package/vendor/abseil-cpp/absl/debugging/internal/symbolize.h +2 -2
- package/vendor/abseil-cpp/absl/debugging/stacktrace.cc +35 -67
- package/vendor/abseil-cpp/absl/debugging/stacktrace.h +3 -0
- package/vendor/abseil-cpp/absl/debugging/stacktrace_benchmark.cc +24 -1
- package/vendor/abseil-cpp/absl/debugging/stacktrace_test.cc +39 -15
- package/vendor/abseil-cpp/absl/debugging/symbolize_emscripten.inc +4 -17
- package/vendor/abseil-cpp/absl/debugging/symbolize_test.cc +25 -40
- package/vendor/abseil-cpp/absl/debugging/symbolize_win32.inc +2 -4
- package/vendor/abseil-cpp/absl/flags/BUILD.bazel +1 -0
- package/vendor/abseil-cpp/absl/flags/declare.h +9 -0
- package/vendor/abseil-cpp/absl/flags/flag.h +2 -1
- package/vendor/abseil-cpp/absl/flags/internal/commandlineflag.h +1 -1
- package/vendor/abseil-cpp/absl/flags/internal/flag.cc +3 -2
- package/vendor/abseil-cpp/absl/flags/marshalling.cc +1 -16
- package/vendor/abseil-cpp/absl/flags/parse.cc +4 -2
- package/vendor/abseil-cpp/absl/flags/parse_test.cc +1 -1
- package/vendor/abseil-cpp/absl/flags/reflection.cc +4 -3
- package/vendor/abseil-cpp/absl/functional/BUILD.bazel +4 -0
- package/vendor/abseil-cpp/absl/functional/CMakeLists.txt +4 -0
- package/vendor/abseil-cpp/absl/functional/any_invocable.h +3 -1
- package/vendor/abseil-cpp/absl/functional/function_ref.h +125 -20
- package/vendor/abseil-cpp/absl/functional/function_ref_test.cc +122 -9
- package/vendor/abseil-cpp/absl/functional/internal/any_invocable.h +13 -2
- package/vendor/abseil-cpp/absl/functional/internal/function_ref.h +42 -4
- package/vendor/abseil-cpp/absl/hash/hash_benchmark.cc +11 -0
- package/vendor/abseil-cpp/absl/hash/hash_test.cc +5 -2
- package/vendor/abseil-cpp/absl/hash/internal/hash.cc +184 -53
- package/vendor/abseil-cpp/absl/hash/internal/hash.h +116 -10
- package/vendor/abseil-cpp/absl/hash/internal/low_level_hash_test.cc +43 -4
- package/vendor/abseil-cpp/absl/log/BUILD.bazel +2 -0
- package/vendor/abseil-cpp/absl/log/CMakeLists.txt +35 -1
- package/vendor/abseil-cpp/absl/log/check_test_impl.inc +59 -4
- package/vendor/abseil-cpp/absl/log/die_if_null.cc +3 -1
- package/vendor/abseil-cpp/absl/log/die_if_null.h +24 -3
- package/vendor/abseil-cpp/absl/log/internal/BUILD.bazel +31 -1
- package/vendor/abseil-cpp/absl/log/internal/check_impl.h +2 -1
- package/vendor/abseil-cpp/absl/log/internal/check_op.cc +3 -1
- package/vendor/abseil-cpp/absl/log/internal/check_op.h +44 -18
- package/vendor/abseil-cpp/absl/log/internal/conditions.h +38 -35
- package/vendor/abseil-cpp/absl/log/internal/container.h +312 -0
- package/vendor/abseil-cpp/absl/log/internal/container_test.cc +254 -0
- package/vendor/abseil-cpp/absl/log/internal/log_impl.h +108 -110
- package/vendor/abseil-cpp/absl/log/internal/log_message.cc +5 -2
- package/vendor/abseil-cpp/absl/log/internal/log_message.h +5 -1
- package/vendor/abseil-cpp/absl/log/internal/strip.h +30 -31
- package/vendor/abseil-cpp/absl/log/internal/vlog_config.cc +19 -19
- package/vendor/abseil-cpp/absl/log/internal/vlog_config.h +0 -1
- package/vendor/abseil-cpp/absl/log/log.h +2 -2
- package/vendor/abseil-cpp/absl/meta/BUILD.bazel +51 -0
- package/vendor/abseil-cpp/absl/meta/CMakeLists.txt +46 -0
- package/vendor/abseil-cpp/absl/meta/internal/constexpr_testing.h +73 -0
- package/vendor/abseil-cpp/absl/meta/internal/constexpr_testing_test.cc +40 -0
- package/vendor/abseil-cpp/absl/meta/internal/requires.h +67 -0
- package/vendor/abseil-cpp/absl/meta/internal/requires_test.cc +66 -0
- package/vendor/abseil-cpp/absl/meta/type_traits.h +42 -1
- package/vendor/abseil-cpp/absl/meta/type_traits_test.cc +14 -0
- package/vendor/abseil-cpp/absl/numeric/int128.h +41 -21
- package/vendor/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +16 -22
- package/vendor/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +5 -7
- package/vendor/abseil-cpp/absl/numeric/int128_test.cc +52 -5
- package/vendor/abseil-cpp/absl/profiling/BUILD.bazel +1 -0
- package/vendor/abseil-cpp/absl/profiling/CMakeLists.txt +1 -0
- package/vendor/abseil-cpp/absl/profiling/hashtable.cc +18 -7
- package/vendor/abseil-cpp/absl/profiling/internal/profile_builder.cc +1 -0
- package/vendor/abseil-cpp/absl/random/internal/fastmath_test.cc +3 -5
- package/vendor/abseil-cpp/absl/random/internal/platform.h +0 -13
- package/vendor/abseil-cpp/absl/random/internal/randen_engine_test.cc +0 -1
- package/vendor/abseil-cpp/absl/random/internal/seed_material.cc +1 -27
- package/vendor/abseil-cpp/absl/status/BUILD.bazel +17 -0
- package/vendor/abseil-cpp/absl/status/CMakeLists.txt +16 -0
- package/vendor/abseil-cpp/absl/status/internal/status_internal.h +4 -2
- package/vendor/abseil-cpp/absl/status/internal/status_matchers.h +2 -2
- package/vendor/abseil-cpp/absl/status/internal/statusor_internal.h +2 -1
- package/vendor/abseil-cpp/absl/status/status.cc +4 -0
- package/vendor/abseil-cpp/absl/status/status.h +5 -0
- package/vendor/abseil-cpp/absl/status/status_matchers.h +48 -0
- package/vendor/abseil-cpp/absl/status/status_matchers_test.cc +27 -0
- package/vendor/abseil-cpp/absl/status/status_test.cc +1 -0
- package/vendor/abseil-cpp/absl/status/statusor.h +1 -1
- package/vendor/abseil-cpp/absl/strings/BUILD.bazel +101 -21
- package/vendor/abseil-cpp/absl/strings/CMakeLists.txt +99 -5
- package/vendor/abseil-cpp/absl/strings/ascii.h +9 -4
- package/vendor/abseil-cpp/absl/strings/cord.cc +15 -10
- package/vendor/abseil-cpp/absl/strings/cord.h +1 -1
- package/vendor/abseil-cpp/absl/strings/escaping.cc +126 -94
- package/vendor/abseil-cpp/absl/strings/internal/append_and_overwrite.h +93 -0
- package/vendor/abseil-cpp/absl/strings/internal/append_and_overwrite_test.cc +95 -0
- package/vendor/abseil-cpp/absl/strings/internal/cord_internal.h +2 -0
- package/vendor/abseil-cpp/absl/strings/internal/cord_rep_btree_test.cc +8 -8
- package/vendor/abseil-cpp/absl/strings/internal/cordz_info.cc +24 -18
- package/vendor/abseil-cpp/absl/strings/internal/cordz_info.h +10 -16
- package/vendor/abseil-cpp/absl/strings/internal/escaping.h +9 -7
- package/vendor/abseil-cpp/absl/strings/internal/generic_printer.cc +107 -0
- package/vendor/abseil-cpp/absl/strings/internal/generic_printer.h +115 -0
- package/vendor/abseil-cpp/absl/strings/internal/generic_printer_internal.h +423 -0
- package/vendor/abseil-cpp/absl/strings/internal/generic_printer_test.cc +685 -0
- package/vendor/abseil-cpp/absl/strings/internal/resize_uninitialized.h +0 -12
- package/vendor/abseil-cpp/absl/strings/internal/str_format/checker.h +2 -4
- package/vendor/abseil-cpp/absl/strings/internal/str_format/convert_test.cc +21 -7
- package/vendor/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +495 -8
- package/vendor/abseil-cpp/absl/strings/internal/str_join_internal.h +18 -15
- package/vendor/abseil-cpp/absl/strings/numbers.cc +71 -8
- package/vendor/abseil-cpp/absl/strings/numbers.h +25 -12
- package/vendor/abseil-cpp/absl/strings/numbers_test.cc +70 -0
- package/vendor/abseil-cpp/absl/strings/resize_and_overwrite.h +194 -0
- package/vendor/abseil-cpp/absl/strings/resize_and_overwrite_test.cc +154 -0
- package/vendor/abseil-cpp/absl/strings/str_cat.cc +96 -91
- package/vendor/abseil-cpp/absl/strings/str_cat.h +17 -12
- package/vendor/abseil-cpp/absl/strings/str_format_test.cc +4 -4
- package/vendor/abseil-cpp/absl/strings/str_split.h +1 -1
- package/vendor/abseil-cpp/absl/strings/str_split_test.cc +1 -1
- package/vendor/abseil-cpp/absl/strings/string_view.h +8 -718
- package/vendor/abseil-cpp/absl/strings/string_view_test.cc +1 -1265
- package/vendor/abseil-cpp/absl/strings/substitute.cc +24 -24
- package/vendor/abseil-cpp/absl/synchronization/BUILD.bazel +2 -3
- package/vendor/abseil-cpp/absl/synchronization/CMakeLists.txt +1 -0
- package/vendor/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +2 -2
- package/vendor/abseil-cpp/absl/synchronization/internal/kernel_timeout_test.cc +15 -5
- package/vendor/abseil-cpp/absl/synchronization/mutex.cc +2 -1
- package/vendor/abseil-cpp/absl/synchronization/mutex.h +47 -23
- package/vendor/abseil-cpp/absl/synchronization/notification.h +1 -1
- package/vendor/abseil-cpp/absl/time/CMakeLists.txt +2 -0
- package/vendor/abseil-cpp/absl/time/civil_time_benchmark.cc +1 -2
- package/vendor/abseil-cpp/absl/time/civil_time_test.cc +58 -103
- package/vendor/abseil-cpp/absl/time/clock.cc +18 -16
- package/vendor/abseil-cpp/absl/time/clock_test.cc +2 -2
- package/vendor/abseil-cpp/absl/time/duration_benchmark.cc +144 -0
- package/vendor/abseil-cpp/absl/time/duration_test.cc +26 -29
- package/vendor/abseil-cpp/absl/time/internal/cctz/BUILD.bazel +7 -1
- package/vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +4 -2
- package/vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +6 -103
- package/vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.cc +186 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.h +37 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/version +1 -1
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Ensenada +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Santa_Isabel +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Tijuana +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Mexico/BajaNorte +0 -0
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/iso3166.tab +9 -9
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zone1970.tab +12 -12
- package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zonenow.tab +47 -47
- package/vendor/abseil-cpp/absl/time/time.cc +4 -4
- package/vendor/abseil-cpp/absl/time/time.h +10 -10
- package/vendor/abseil-cpp/absl/time/time_test.cc +1 -0
- package/vendor/abseil-cpp/absl/types/compare.h +62 -61
- package/vendor/abseil-cpp/absl/types/compare_test.cc +3 -3
- package/vendor/abseil-cpp/absl/types/internal/span.h +1 -0
- package/vendor/abseil-cpp/absl/types/optional.h +2 -2
- package/vendor/abseil-cpp/absl/types/span.h +10 -2
- package/vendor/abseil-cpp/absl/utility/utility.h +13 -0
- package/vendor/abseil-cpp/ci/absl_alternate_options.h +0 -1
- package/vendor/abseil-cpp/ci/cmake_common.sh +1 -1
- package/vendor/abseil-cpp/ci/cmake_install_test.sh +6 -0
- package/vendor/abseil-cpp/ci/linux_arm_clang-latest_libcxx_bazel.sh +1 -0
- package/vendor/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh +2 -0
- package/vendor/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh +1 -0
- package/vendor/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh +1 -0
- package/vendor/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh +1 -0
- package/vendor/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh +1 -0
- package/vendor/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh +1 -0
- package/vendor/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh +6 -0
- package/vendor/abseil-cpp/ci/linux_gcc_alpine_cmake.sh +6 -0
- package/vendor/abseil-cpp/ci/macos_xcode_bazel.sh +3 -2
- package/vendor/abseil-cpp/ci/macos_xcode_cmake.sh +5 -0
- package/vendor/abseil-cpp/ci/windows_clangcl_bazel.bat +1 -0
- package/vendor/abseil-cpp/ci/windows_msvc_bazel.bat +1 -0
- package/vendor/abseil-cpp/ci/windows_msvc_cmake.bat +6 -1
- package/vendor/abseil-cpp/absl/base/internal/identity.h +0 -39
- package/vendor/abseil-cpp/absl/strings/string_view.cc +0 -257
- package/vendor/abseil-cpp/absl/strings/string_view_benchmark.cc +0 -380
|
@@ -84,11 +84,9 @@ class ABSL_ATTRIBUTE_WARN_UNUSED FixedArray {
|
|
|
84
84
|
static constexpr size_t kInlineBytesDefault = 256;
|
|
85
85
|
|
|
86
86
|
using AllocatorTraits = std::allocator_traits<A>;
|
|
87
|
-
// std::iterator_traits isn't guaranteed to be SFINAE-friendly until C++17,
|
|
88
|
-
// but this seems to be mostly pedantic.
|
|
89
87
|
template <typename Iterator>
|
|
90
|
-
using
|
|
91
|
-
base_internal::
|
|
88
|
+
using EnableIfInputIterator =
|
|
89
|
+
std::enable_if_t<base_internal::IsAtLeastInputIterator<Iterator>::value>;
|
|
92
90
|
static constexpr bool NoexceptCopyable() {
|
|
93
91
|
return std::is_nothrow_copy_constructible<StorageElement>::value &&
|
|
94
92
|
absl::allocator_is_nothrow<allocator_type>::value;
|
|
@@ -161,8 +159,8 @@ class ABSL_ATTRIBUTE_WARN_UNUSED FixedArray {
|
|
|
161
159
|
|
|
162
160
|
// Creates an array initialized with the elements from the input
|
|
163
161
|
// range. The array's size will always be `std::distance(first, last)`.
|
|
164
|
-
// REQUIRES: Iterator must be a
|
|
165
|
-
template <typename Iterator,
|
|
162
|
+
// REQUIRES: Iterator must be a input_iterator or better.
|
|
163
|
+
template <typename Iterator, EnableIfInputIterator<Iterator>* = nullptr>
|
|
166
164
|
FixedArray(Iterator first, Iterator last,
|
|
167
165
|
const allocator_type& a = allocator_type())
|
|
168
166
|
: storage_(std::distance(first, last), a) {
|
|
@@ -127,13 +127,17 @@ struct FlatHashMapPolicy;
|
|
|
127
127
|
// if (result != ducks.end()) {
|
|
128
128
|
// std::cout << "Result: " << result->second << std::endl;
|
|
129
129
|
// }
|
|
130
|
-
template <
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
template <
|
|
131
|
+
class K, class V,
|
|
132
|
+
class Hash =
|
|
133
|
+
typename container_internal::FlatHashMapPolicy<K, V>::DefaultHash,
|
|
134
|
+
class Eq = typename container_internal::FlatHashMapPolicy<K, V>::DefaultEq,
|
|
135
|
+
class Allocator =
|
|
136
|
+
typename container_internal::FlatHashMapPolicy<K, V>::DefaultAlloc>
|
|
133
137
|
class ABSL_ATTRIBUTE_OWNER flat_hash_map
|
|
134
|
-
: public absl::container_internal::
|
|
138
|
+
: public absl::container_internal::InstantiateRawHashMap<
|
|
135
139
|
absl::container_internal::FlatHashMapPolicy<K, V>, Hash, Eq,
|
|
136
|
-
Allocator
|
|
140
|
+
Allocator>::type {
|
|
137
141
|
using Base = typename flat_hash_map::raw_hash_map;
|
|
138
142
|
|
|
139
143
|
public:
|
|
@@ -462,7 +466,9 @@ class ABSL_ATTRIBUTE_OWNER flat_hash_map
|
|
|
462
466
|
//
|
|
463
467
|
// Sets the number of slots in the `flat_hash_map` to the number needed to
|
|
464
468
|
// accommodate at least `count` total elements without exceeding the current
|
|
465
|
-
// maximum load factor, and may rehash the container if needed.
|
|
469
|
+
// maximum load factor, and may rehash the container if needed. After this
|
|
470
|
+
// returns, it is guaranteed that `count - size()` elements can be inserted
|
|
471
|
+
// into the `flat_hash_map` without another rehash.
|
|
466
472
|
using Base::reserve;
|
|
467
473
|
|
|
468
474
|
// flat_hash_map::at()
|
|
@@ -635,6 +641,10 @@ struct FlatHashMapPolicy {
|
|
|
635
641
|
using mapped_type = V;
|
|
636
642
|
using init_type = std::pair</*non const*/ key_type, mapped_type>;
|
|
637
643
|
|
|
644
|
+
using DefaultHash = DefaultHashContainerHash<K>;
|
|
645
|
+
using DefaultEq = DefaultHashContainerEq<K>;
|
|
646
|
+
using DefaultAlloc = std::allocator<std::pair<const K, V>>;
|
|
647
|
+
|
|
638
648
|
template <class Allocator, class... Args>
|
|
639
649
|
static void construct(Allocator* alloc, slot_type* slot, Args&&... args) {
|
|
640
650
|
slot_policy::construct(alloc, slot, std::forward<Args>(args)...);
|
|
@@ -39,8 +39,7 @@ namespace absl {
|
|
|
39
39
|
ABSL_NAMESPACE_BEGIN
|
|
40
40
|
namespace container_internal {
|
|
41
41
|
namespace {
|
|
42
|
-
|
|
43
|
-
using ::absl::container_internal::hash_internal::EnumClass;
|
|
42
|
+
|
|
44
43
|
using ::testing::_;
|
|
45
44
|
using ::testing::IsEmpty;
|
|
46
45
|
using ::testing::Pair;
|
|
@@ -124,12 +124,16 @@ struct FlatHashSetPolicy;
|
|
|
124
124
|
// if (ducks.contains("dewey")) {
|
|
125
125
|
// std::cout << "We found dewey!" << std::endl;
|
|
126
126
|
// }
|
|
127
|
-
template <
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
template <
|
|
128
|
+
class T,
|
|
129
|
+
class Hash = typename container_internal::FlatHashSetPolicy<T>::DefaultHash,
|
|
130
|
+
class Eq = typename container_internal::FlatHashSetPolicy<T>::DefaultEq,
|
|
131
|
+
class Allocator =
|
|
132
|
+
typename container_internal::FlatHashSetPolicy<T>::DefaultAlloc>
|
|
130
133
|
class ABSL_ATTRIBUTE_OWNER flat_hash_set
|
|
131
|
-
: public absl::container_internal::
|
|
132
|
-
absl::container_internal::FlatHashSetPolicy<T>, Hash, Eq,
|
|
134
|
+
: public absl::container_internal::InstantiateRawHashSet<
|
|
135
|
+
absl::container_internal::FlatHashSetPolicy<T>, Hash, Eq,
|
|
136
|
+
Allocator>::type {
|
|
133
137
|
using Base = typename flat_hash_set::raw_hash_set;
|
|
134
138
|
|
|
135
139
|
public:
|
|
@@ -396,7 +400,9 @@ class ABSL_ATTRIBUTE_OWNER flat_hash_set
|
|
|
396
400
|
//
|
|
397
401
|
// Sets the number of slots in the `flat_hash_set` to the number needed to
|
|
398
402
|
// accommodate at least `count` total elements without exceeding the current
|
|
399
|
-
// maximum load factor, and may rehash the container if needed.
|
|
403
|
+
// maximum load factor, and may rehash the container if needed. After this
|
|
404
|
+
// returns, it is guaranteed that `count - size()` elements can be inserted
|
|
405
|
+
// into the `flat_hash_set` without another rehash.
|
|
400
406
|
using Base::reserve;
|
|
401
407
|
|
|
402
408
|
// flat_hash_set::contains()
|
|
@@ -533,6 +539,10 @@ struct FlatHashSetPolicy {
|
|
|
533
539
|
using init_type = T;
|
|
534
540
|
using constant_iterators = std::true_type;
|
|
535
541
|
|
|
542
|
+
using DefaultHash = DefaultHashContainerHash<T>;
|
|
543
|
+
using DefaultEq = DefaultHashContainerEq<T>;
|
|
544
|
+
using DefaultAlloc = std::allocator<T>;
|
|
545
|
+
|
|
536
546
|
template <class Allocator, class... Args>
|
|
537
547
|
static void construct(Allocator* alloc, slot_type* slot, Args&&... args) {
|
|
538
548
|
absl::allocator_traits<Allocator>::construct(*alloc, slot,
|
|
@@ -43,8 +43,6 @@ ABSL_NAMESPACE_BEGIN
|
|
|
43
43
|
namespace container_internal {
|
|
44
44
|
namespace {
|
|
45
45
|
|
|
46
|
-
using ::absl::container_internal::hash_internal::Enum;
|
|
47
|
-
using ::absl::container_internal::hash_internal::EnumClass;
|
|
48
46
|
using ::testing::IsEmpty;
|
|
49
47
|
using ::testing::Pointee;
|
|
50
48
|
using ::testing::UnorderedElementsAre;
|
|
@@ -815,13 +815,11 @@ class ABSL_ATTRIBUTE_WARN_UNUSED InlinedVector {
|
|
|
815
815
|
// `InlinedVector::clear()`
|
|
816
816
|
//
|
|
817
817
|
// Destroys all elements in the inlined vector, setting the size to `0` and
|
|
818
|
-
//
|
|
818
|
+
// preserving capacity.
|
|
819
819
|
void clear() noexcept {
|
|
820
820
|
inlined_vector_internal::DestroyAdapter<A>::DestroyElements(
|
|
821
821
|
storage_.GetAllocator(), data(), size());
|
|
822
|
-
storage_.
|
|
823
|
-
|
|
824
|
-
storage_.SetInlinedSize(0);
|
|
822
|
+
storage_.SetSize(0);
|
|
825
823
|
}
|
|
826
824
|
|
|
827
825
|
// `InlinedVector::reserve(...)`
|
|
@@ -1011,6 +1009,16 @@ H AbslHashValue(H h, const absl::InlinedVector<T, N, A>& a) {
|
|
|
1011
1009
|
return H::combine_contiguous(std::move(h), a.data(), a.size());
|
|
1012
1010
|
}
|
|
1013
1011
|
|
|
1012
|
+
template <typename T, size_t N, typename A, typename Predicate>
|
|
1013
|
+
constexpr typename InlinedVector<T, N, A>::size_type erase_if(
|
|
1014
|
+
InlinedVector<T, N, A>& v, Predicate pred) {
|
|
1015
|
+
const auto it = std::remove_if(v.begin(), v.end(), std::move(pred));
|
|
1016
|
+
const auto removed = static_cast<typename InlinedVector<T, N, A>::size_type>(
|
|
1017
|
+
std::distance(it, v.end()));
|
|
1018
|
+
v.erase(it, v.end());
|
|
1019
|
+
return removed;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1014
1022
|
ABSL_NAMESPACE_END
|
|
1015
1023
|
} // namespace absl
|
|
1016
1024
|
|
|
@@ -51,6 +51,7 @@ using testing::AllOf;
|
|
|
51
51
|
using testing::Each;
|
|
52
52
|
using testing::ElementsAre;
|
|
53
53
|
using testing::ElementsAreArray;
|
|
54
|
+
using testing::IsEmpty;
|
|
54
55
|
using testing::Eq;
|
|
55
56
|
using testing::Gt;
|
|
56
57
|
using testing::Pointee;
|
|
@@ -919,7 +920,9 @@ TEST(IntVec, Clear) {
|
|
|
919
920
|
SCOPED_TRACE(len);
|
|
920
921
|
IntVec v;
|
|
921
922
|
Fill(&v, len);
|
|
923
|
+
size_t capacity_before_clear = v.capacity();
|
|
922
924
|
v.clear();
|
|
925
|
+
EXPECT_EQ(v.capacity(), capacity_before_clear);
|
|
923
926
|
EXPECT_EQ(0u, v.size());
|
|
924
927
|
EXPECT_EQ(v.begin(), v.end());
|
|
925
928
|
}
|
|
@@ -2254,4 +2257,22 @@ TEST(StorageTest, InlinedCapacityAutoIncrease) {
|
|
|
2254
2257
|
sizeof(MySpan<int>) / sizeof(int));
|
|
2255
2258
|
}
|
|
2256
2259
|
|
|
2260
|
+
TEST(IntVec, EraseIf) {
|
|
2261
|
+
IntVec v = {3, 1, 2, 0};
|
|
2262
|
+
EXPECT_EQ(absl::erase_if(v, [](int i) { return i > 1; }), 2u);
|
|
2263
|
+
EXPECT_THAT(v, ElementsAre(1, 0));
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
TEST(IntVec, EraseIfMatchesNone) {
|
|
2267
|
+
IntVec v = {1, 2, 3};
|
|
2268
|
+
EXPECT_EQ(absl::erase_if(v, [](int i) { return i > 10; }), 0u);;
|
|
2269
|
+
EXPECT_THAT(v, ElementsAre(1, 2, 3));
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
TEST(IntVec, EraseIfMatchesAll) {
|
|
2273
|
+
IntVec v = {1, 2, 3};
|
|
2274
|
+
EXPECT_EQ(absl::erase_if(v, [](int i) { return i > 0; }), 3u);
|
|
2275
|
+
EXPECT_THAT(v, IsEmpty());
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2257
2278
|
} // anonymous namespace
|
|
@@ -640,12 +640,12 @@ class btree_map_container : public btree_set_container<Tree> {
|
|
|
640
640
|
}
|
|
641
641
|
template <class K = key_type, int = EnableIf<LifetimeBoundK<K, false>>()>
|
|
642
642
|
mapped_type &operator[](key_arg<K> &&k) ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
|
643
|
-
return try_emplace(std::forward<K
|
|
643
|
+
return try_emplace(std::forward<key_arg<K>>(k)).first->second;
|
|
644
644
|
}
|
|
645
645
|
template <class K = key_type, int &..., EnableIf<LifetimeBoundK<K, true>> = 0>
|
|
646
646
|
mapped_type &operator[](key_arg<K> &&k ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY(
|
|
647
647
|
this)) ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
|
648
|
-
return this->template operator[]<K, 0>(std::forward<K
|
|
648
|
+
return this->template operator[]<K, 0>(std::forward<key_arg<K>>(k));
|
|
649
649
|
}
|
|
650
650
|
|
|
651
651
|
template <typename K = key_type>
|
|
@@ -672,27 +672,36 @@ class btree_map_container : public btree_set_container<Tree> {
|
|
|
672
672
|
std::pair<iterator, bool> insert_or_assign_impl(K &&k, M &&obj) {
|
|
673
673
|
const std::pair<iterator, bool> ret =
|
|
674
674
|
this->tree_.insert_unique(k, std::forward<K>(k), std::forward<M>(obj));
|
|
675
|
-
if (!ret.second)
|
|
675
|
+
if (!ret.second) {
|
|
676
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
677
|
+
ret.first->second = std::forward<M>(obj);
|
|
678
|
+
}
|
|
676
679
|
return ret;
|
|
677
680
|
}
|
|
678
681
|
template <class K, class M>
|
|
679
682
|
iterator insert_or_assign_hint_impl(const_iterator hint, K &&k, M &&obj) {
|
|
680
683
|
const std::pair<iterator, bool> ret = this->tree_.insert_hint_unique(
|
|
681
684
|
iterator(hint), k, std::forward<K>(k), std::forward<M>(obj));
|
|
682
|
-
if (!ret.second)
|
|
685
|
+
if (!ret.second) {
|
|
686
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
687
|
+
ret.first->second = std::forward<M>(obj);
|
|
688
|
+
}
|
|
683
689
|
return ret.first;
|
|
684
690
|
}
|
|
685
691
|
|
|
686
692
|
template <class K, class... Args>
|
|
687
693
|
std::pair<iterator, bool> try_emplace_impl(K &&k, Args &&... args) {
|
|
688
694
|
return this->tree_.insert_unique(
|
|
695
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
689
696
|
k, std::piecewise_construct, std::forward_as_tuple(std::forward<K>(k)),
|
|
690
697
|
std::forward_as_tuple(std::forward<Args>(args)...));
|
|
691
698
|
}
|
|
692
699
|
template <class K, class... Args>
|
|
693
700
|
iterator try_emplace_hint_impl(const_iterator hint, K &&k, Args &&... args) {
|
|
694
701
|
return this->tree_
|
|
695
|
-
.insert_hint_unique(iterator(hint),
|
|
702
|
+
.insert_hint_unique(iterator(hint),
|
|
703
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
704
|
+
k, std::piecewise_construct,
|
|
696
705
|
std::forward_as_tuple(std::forward<K>(k)),
|
|
697
706
|
std::forward_as_tuple(std::forward<Args>(args)...))
|
|
698
707
|
.first;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
#ifndef ABSL_CONTAINER_INTERNAL_CHUNKED_QUEUE_H_
|
|
16
|
+
#define ABSL_CONTAINER_INTERNAL_CHUNKED_QUEUE_H_
|
|
17
|
+
|
|
18
|
+
#include <algorithm>
|
|
19
|
+
#include <cstddef>
|
|
20
|
+
#include <cstdint>
|
|
21
|
+
#include <initializer_list>
|
|
22
|
+
#include <iterator>
|
|
23
|
+
#include <memory>
|
|
24
|
+
#include <new>
|
|
25
|
+
#include <tuple>
|
|
26
|
+
#include <type_traits>
|
|
27
|
+
#include <utility>
|
|
28
|
+
|
|
29
|
+
#include "absl/base/attributes.h"
|
|
30
|
+
#include "absl/base/config.h"
|
|
31
|
+
#include "absl/base/macros.h"
|
|
32
|
+
#include "absl/container/internal/layout.h"
|
|
33
|
+
|
|
34
|
+
namespace absl {
|
|
35
|
+
ABSL_NAMESPACE_BEGIN
|
|
36
|
+
namespace container_internal {
|
|
37
|
+
|
|
38
|
+
// ChunkedQueueBlock defines a node in a forward list of uninitialized storage
|
|
39
|
+
// of size T's. The user is responsible for constructing and destroying T's in
|
|
40
|
+
// said storage.
|
|
41
|
+
//
|
|
42
|
+
// ChunkedQueueBlock::New(size) returns said node, with at least size_hint T's
|
|
43
|
+
// of uninitialized storage.
|
|
44
|
+
template <typename T, typename Allocator>
|
|
45
|
+
class ChunkedQueueBlock {
|
|
46
|
+
private:
|
|
47
|
+
using ChunkedQueueBlockAllocator = typename std::allocator_traits<
|
|
48
|
+
Allocator>::template rebind_alloc<ChunkedQueueBlock>;
|
|
49
|
+
using ByteAllocator =
|
|
50
|
+
typename std::allocator_traits<Allocator>::template rebind_alloc<char>;
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
// NB, instances of this must not be created or destroyed directly, only via
|
|
54
|
+
// the New() and Delete() methods. (This notionally-private constructor is
|
|
55
|
+
// public only to allow access from allocator types used by New().)
|
|
56
|
+
explicit ChunkedQueueBlock(size_t size)
|
|
57
|
+
: next_(nullptr), limit_(start() + size) {}
|
|
58
|
+
|
|
59
|
+
// Must be deleted by ChunkedQueueBlock::Delete.
|
|
60
|
+
static ChunkedQueueBlock* New(size_t size_hint, Allocator* alloc) { // NOLINT
|
|
61
|
+
ABSL_ASSERT(size_hint >= size_t{1});
|
|
62
|
+
size_t allocation_bytes = AllocSize(size_hint);
|
|
63
|
+
void* mem;
|
|
64
|
+
std::tie(mem, allocation_bytes) = Allocate(allocation_bytes, alloc);
|
|
65
|
+
const size_t element_count =
|
|
66
|
+
(allocation_bytes - start_offset()) / sizeof(T);
|
|
67
|
+
ChunkedQueueBlock* as_block = static_cast<ChunkedQueueBlock*>(mem);
|
|
68
|
+
ChunkedQueueBlockAllocator block_alloc(*alloc);
|
|
69
|
+
std::allocator_traits<ChunkedQueueBlockAllocator>::construct(
|
|
70
|
+
block_alloc, as_block, element_count);
|
|
71
|
+
return as_block;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static void Delete(ChunkedQueueBlock* ptr, Allocator* alloc) {
|
|
75
|
+
const size_t allocation_bytes = AllocSize(ptr->size());
|
|
76
|
+
ChunkedQueueBlockAllocator block_alloc(*alloc);
|
|
77
|
+
std::allocator_traits<ChunkedQueueBlockAllocator>::destroy(block_alloc,
|
|
78
|
+
ptr);
|
|
79
|
+
if constexpr (std::is_same_v<ByteAllocator, std::allocator<char>>) {
|
|
80
|
+
#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
|
|
81
|
+
if (alignment() > __STDCPP_DEFAULT_NEW_ALIGNMENT__) {
|
|
82
|
+
::operator delete(ptr
|
|
83
|
+
#ifdef __cpp_sized_deallocation
|
|
84
|
+
,
|
|
85
|
+
allocation_bytes
|
|
86
|
+
#endif
|
|
87
|
+
,
|
|
88
|
+
std::align_val_t(alignment()));
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
#endif
|
|
92
|
+
::operator delete(ptr);
|
|
93
|
+
} else {
|
|
94
|
+
void* mem = ptr;
|
|
95
|
+
ByteAllocator byte_alloc(*alloc);
|
|
96
|
+
std::allocator_traits<ByteAllocator>::deallocate(
|
|
97
|
+
byte_alloc, static_cast<char*>(mem), allocation_bytes);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
ChunkedQueueBlock* next() const { return next_; }
|
|
102
|
+
void set_next(ChunkedQueueBlock* next) { next_ = next; }
|
|
103
|
+
T* start() {
|
|
104
|
+
return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(this) +
|
|
105
|
+
start_offset());
|
|
106
|
+
}
|
|
107
|
+
T* limit() { return limit_; }
|
|
108
|
+
size_t size() { return limit() - start(); }
|
|
109
|
+
|
|
110
|
+
static constexpr size_t block_size_from_bytes(size_t bytes) {
|
|
111
|
+
return bytes <= static_cast<size_t>(start_offset())
|
|
112
|
+
? size_t{1}
|
|
113
|
+
: elements_in_bytes(bytes - start_offset());
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private:
|
|
117
|
+
ChunkedQueueBlock(const ChunkedQueueBlock&) = delete;
|
|
118
|
+
ChunkedQueueBlock& operator=(const ChunkedQueueBlock&) = delete;
|
|
119
|
+
|
|
120
|
+
// The byte size to allocate to ensure space for `min_element_count` elements.
|
|
121
|
+
static constexpr size_t AllocSize(size_t min_element_count) {
|
|
122
|
+
return absl::container_internal::Layout<ChunkedQueueBlock, T>(
|
|
123
|
+
1, min_element_count)
|
|
124
|
+
.AllocSize();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
static constexpr ptrdiff_t start_offset() {
|
|
128
|
+
return absl::container_internal::Layout<ChunkedQueueBlock, T>(1, 1)
|
|
129
|
+
.template Offset<1>();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
static constexpr size_t alignment() {
|
|
133
|
+
return absl::container_internal::Layout<ChunkedQueueBlock, T>(1, 1)
|
|
134
|
+
.Alignment();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
static constexpr size_t elements_in_bytes(size_t bytes) {
|
|
138
|
+
return (bytes + sizeof(T) - 1) / sizeof(T);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
static std::pair<void*, size_t> Allocate(size_t allocation_bytes,
|
|
142
|
+
Allocator* alloc) {
|
|
143
|
+
// If we're using the default allocator, then we can use new.
|
|
144
|
+
void* mem;
|
|
145
|
+
if constexpr (std::is_same_v<ByteAllocator, std::allocator<char>>) {
|
|
146
|
+
// Older GCC versions have an unused variable warning on `alloc` inside
|
|
147
|
+
// this constexpr branch.
|
|
148
|
+
static_cast<void>(alloc);
|
|
149
|
+
#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
|
|
150
|
+
if (alignment() > __STDCPP_DEFAULT_NEW_ALIGNMENT__) {
|
|
151
|
+
// Align the allocation to respect alignof(T).
|
|
152
|
+
mem = ::operator new(allocation_bytes, std::align_val_t(alignment()));
|
|
153
|
+
return {mem, allocation_bytes};
|
|
154
|
+
}
|
|
155
|
+
#endif
|
|
156
|
+
mem = ::operator new(allocation_bytes);
|
|
157
|
+
} else {
|
|
158
|
+
ByteAllocator byte_alloc(*alloc);
|
|
159
|
+
mem = std::allocator_traits<ByteAllocator>::allocate(byte_alloc,
|
|
160
|
+
allocation_bytes);
|
|
161
|
+
}
|
|
162
|
+
return {mem, allocation_bytes};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
ChunkedQueueBlock* next_;
|
|
166
|
+
T* limit_;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
} // namespace container_internal
|
|
170
|
+
ABSL_NAMESPACE_END
|
|
171
|
+
} // namespace absl
|
|
172
|
+
|
|
173
|
+
#endif // ABSL_CONTAINER_INTERNAL_CHUNKED_QUEUE_H_
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
#ifndef ABSL_CONTAINER_INTERNAL_COMMON_H_
|
|
16
16
|
#define ABSL_CONTAINER_INTERNAL_COMMON_H_
|
|
17
17
|
|
|
18
|
+
#include <algorithm>
|
|
18
19
|
#include <cassert>
|
|
20
|
+
#include <cstddef>
|
|
21
|
+
#include <tuple>
|
|
19
22
|
#include <type_traits>
|
|
20
23
|
|
|
21
24
|
#include "absl/meta/type_traits.h"
|
|
@@ -243,6 +246,54 @@ struct InsertReturnType {
|
|
|
243
246
|
NodeType node;
|
|
244
247
|
};
|
|
245
248
|
|
|
249
|
+
// Utilities to strip redundant template parameters from the underlying
|
|
250
|
+
// implementation types.
|
|
251
|
+
// We use a variadic pack (ie Params...) to specify required prefix of types for
|
|
252
|
+
// non-default types, and then we use GetFromListOr to select the provided types
|
|
253
|
+
// or the default ones otherwise.
|
|
254
|
+
//
|
|
255
|
+
// These default types do not contribute information for debugging and just
|
|
256
|
+
// bloat the binary.
|
|
257
|
+
// Removing the redundant tail types reduces mangled names and stringified
|
|
258
|
+
// function names like __PRETTY_FUNCTION__.
|
|
259
|
+
//
|
|
260
|
+
// How to use:
|
|
261
|
+
// 1. Define a template with `typename ...Params`
|
|
262
|
+
// 2. Instantiate it via `ApplyWithoutDefaultSuffix<>` to only pass the minimal
|
|
263
|
+
// set of types.
|
|
264
|
+
// 3. Inside the template use `GetFromListOr` to map back from the existing
|
|
265
|
+
// `Params` list to the actual types, filling the gaps when types are
|
|
266
|
+
// missing.
|
|
267
|
+
|
|
268
|
+
template <typename Or, size_t N, typename... Params>
|
|
269
|
+
using GetFromListOr = std::tuple_element_t<(std::min)(N, sizeof...(Params)),
|
|
270
|
+
std::tuple<Params..., Or>>;
|
|
271
|
+
|
|
272
|
+
template <typename... T>
|
|
273
|
+
struct TypeList {
|
|
274
|
+
template <template <typename...> class Template>
|
|
275
|
+
using Apply = Template<T...>;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
// Evaluate to `Template<TPrefix...>` where the last type in the list (if any)
|
|
279
|
+
// is different from the corresponding one in the default list.
|
|
280
|
+
// Eg
|
|
281
|
+
// ApplyWithoutDefaultSuffix<Template, TypeList<a, b, c>, TypeList<a, X, c>>
|
|
282
|
+
// evaluates to
|
|
283
|
+
// Template<a, X>
|
|
284
|
+
template <template <typename...> class Template, typename D, typename T,
|
|
285
|
+
typename L = TypeList<>, typename = void>
|
|
286
|
+
struct ApplyWithoutDefaultSuffix {
|
|
287
|
+
using type = typename L::template Apply<Template>;
|
|
288
|
+
};
|
|
289
|
+
template <template <typename...> class Template, typename D, typename... Ds,
|
|
290
|
+
typename T, typename... Ts, typename... L>
|
|
291
|
+
struct ApplyWithoutDefaultSuffix<
|
|
292
|
+
Template, TypeList<D, Ds...>, TypeList<T, Ts...>, TypeList<L...>,
|
|
293
|
+
std::enable_if_t<!std::is_same_v<TypeList<D, Ds...>, TypeList<T, Ts...>>>>
|
|
294
|
+
: ApplyWithoutDefaultSuffix<Template, TypeList<Ds...>, TypeList<Ts...>,
|
|
295
|
+
TypeList<L..., T>> {};
|
|
296
|
+
|
|
246
297
|
} // namespace container_internal
|
|
247
298
|
ABSL_NAMESPACE_END
|
|
248
299
|
} // namespace absl
|
|
@@ -44,7 +44,12 @@ ABSL_NAMESPACE_BEGIN
|
|
|
44
44
|
namespace container_internal {
|
|
45
45
|
|
|
46
46
|
template <size_t Alignment>
|
|
47
|
-
struct alignas(Alignment) AlignedType {
|
|
47
|
+
struct alignas(Alignment) AlignedType {
|
|
48
|
+
// When alignment is sufficient for the allocated memory to store pointers,
|
|
49
|
+
// include a pointer member so that swisstable backing arrays end up in the
|
|
50
|
+
// pointer-containing partition for heap partitioning.
|
|
51
|
+
std::conditional_t<(Alignment < alignof(void*)), char, void*> pointer;
|
|
52
|
+
};
|
|
48
53
|
|
|
49
54
|
// Allocates at least n bytes aligned to the specified alignment.
|
|
50
55
|
// Alignment must be a power of 2. It must be positive.
|
|
@@ -130,6 +135,7 @@ decltype(std::declval<F>()(std::declval<T>())) WithConstructedImpl(
|
|
|
130
135
|
template <class T, size_t... Is>
|
|
131
136
|
auto TupleRefImpl(T&& t, absl::index_sequence<Is...>)
|
|
132
137
|
-> decltype(std::forward_as_tuple(std::get<Is>(std::forward<T>(t))...)) {
|
|
138
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
133
139
|
return std::forward_as_tuple(std::get<Is>(std::forward<T>(t))...);
|
|
134
140
|
}
|
|
135
141
|
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
#include "gmock/gmock.h"
|
|
27
27
|
#include "gtest/gtest.h"
|
|
28
|
+
#include "absl/base/config.h"
|
|
28
29
|
#include "absl/base/no_destructor.h"
|
|
29
30
|
#include "absl/container/internal/test_instance_tracker.h"
|
|
30
31
|
#include "absl/meta/type_traits.h"
|
|
@@ -42,6 +43,16 @@ using ::testing::ElementsAre;
|
|
|
42
43
|
using ::testing::Gt;
|
|
43
44
|
using ::testing::Pair;
|
|
44
45
|
|
|
46
|
+
#if ABSL_HAVE_BUILTIN(__builtin_infer_alloc_token)
|
|
47
|
+
TEST(Memory, AlignedTypeAllocToken) {
|
|
48
|
+
#if defined(__wasm__)
|
|
49
|
+
GTEST_SKIP() << "Fails on wasm due to lack of heap partitioning support.";
|
|
50
|
+
#endif
|
|
51
|
+
EXPECT_GT(__builtin_infer_alloc_token(sizeof(AlignedType<alignof(void*)>)),
|
|
52
|
+
__builtin_infer_alloc_token(sizeof(int)));
|
|
53
|
+
}
|
|
54
|
+
#endif
|
|
55
|
+
|
|
45
56
|
TEST(Memory, AlignmentLargerThanBase) {
|
|
46
57
|
std::allocator<int8_t> alloc;
|
|
47
58
|
void* mem = Allocate<2>(&alloc, 3);
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
namespace absl {
|
|
27
27
|
ABSL_NAMESPACE_BEGIN
|
|
28
28
|
namespace container_internal {
|
|
29
|
-
namespace hash_internal {
|
|
30
29
|
|
|
31
30
|
std::string Generator<std::string>::operator()() const {
|
|
32
31
|
absl::InsecureBitGen gen;
|
|
@@ -50,7 +49,6 @@ absl::string_view Generator<absl::string_view>::operator()() const {
|
|
|
50
49
|
return res;
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
} // namespace hash_internal
|
|
54
52
|
} // namespace container_internal
|
|
55
53
|
ABSL_NAMESPACE_END
|
|
56
54
|
} // namespace absl
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
#include <utility>
|
|
32
32
|
#include <vector>
|
|
33
33
|
|
|
34
|
+
#include "absl/base/config.h"
|
|
34
35
|
#include "absl/container/internal/hash_policy_testing.h"
|
|
35
36
|
#include "absl/memory/memory.h"
|
|
36
37
|
#include "absl/meta/type_traits.h"
|
|
@@ -40,7 +41,6 @@
|
|
|
40
41
|
namespace absl {
|
|
41
42
|
ABSL_NAMESPACE_BEGIN
|
|
42
43
|
namespace container_internal {
|
|
43
|
-
namespace hash_internal {
|
|
44
44
|
namespace generator_internal {
|
|
45
45
|
|
|
46
46
|
template <class Container, class = void>
|
|
@@ -165,7 +165,6 @@ struct UniqueGenerator {
|
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
|
|
168
|
-
} // namespace hash_internal
|
|
169
168
|
} // namespace container_internal
|
|
170
169
|
ABSL_NAMESPACE_END
|
|
171
170
|
} // namespace absl
|
|
@@ -170,18 +170,4 @@ auto keys(const Set& s)
|
|
|
170
170
|
ABSL_NAMESPACE_END
|
|
171
171
|
} // namespace absl
|
|
172
172
|
|
|
173
|
-
// ABSL_UNORDERED_SUPPORTS_ALLOC_CTORS is false for glibcxx versions
|
|
174
|
-
// where the unordered containers are missing certain constructors that
|
|
175
|
-
// take allocator arguments. This test is defined ad-hoc for the platforms
|
|
176
|
-
// we care about (notably Crosstool 17) because libstdcxx's useless
|
|
177
|
-
// versioning scheme precludes a more principled solution.
|
|
178
|
-
// From GCC-4.9 Changelog: (src: https://gcc.gnu.org/gcc-4.9/changes.html)
|
|
179
|
-
// "the unordered associative containers in <unordered_map> and <unordered_set>
|
|
180
|
-
// meet the allocator-aware container requirements;"
|
|
181
|
-
#if defined(__GLIBCXX__) && __GLIBCXX__ <= 20140425
|
|
182
|
-
#define ABSL_UNORDERED_SUPPORTS_ALLOC_CTORS 0
|
|
183
|
-
#else
|
|
184
|
-
#define ABSL_UNORDERED_SUPPORTS_ALLOC_CTORS 1
|
|
185
|
-
#endif
|
|
186
|
-
|
|
187
173
|
#endif // ABSL_CONTAINER_INTERNAL_HASH_POLICY_TESTING_H_
|
|
@@ -212,6 +212,9 @@ static_assert(
|
|
|
212
212
|
static_assert(ctrl_t::kDeleted == static_cast<ctrl_t>(-2),
|
|
213
213
|
"ctrl_t::kDeleted must be -2 to make the implementation of "
|
|
214
214
|
"ConvertSpecialToEmptyAndFullToDeleted efficient");
|
|
215
|
+
static_assert(ctrl_t::kEmpty == static_cast<ctrl_t>(-128),
|
|
216
|
+
"ctrl_t::kEmpty must be -128 to use saturated subtraction in"
|
|
217
|
+
" ConvertSpecialToEmptyAndFullToDeleted");
|
|
215
218
|
|
|
216
219
|
// Helpers for checking the state of a control byte.
|
|
217
220
|
inline bool IsEmpty(ctrl_t c) { return c == ctrl_t::kEmpty; }
|
|
@@ -329,15 +332,15 @@ struct GroupSse2Impl {
|
|
|
329
332
|
}
|
|
330
333
|
|
|
331
334
|
void ConvertSpecialToEmptyAndFullToDeleted(ctrl_t* dst) const {
|
|
335
|
+
// Take advantage of the fact that kEmpty is already the smallest signed
|
|
336
|
+
// char value, and using a saturated subtraction will not affect it.
|
|
337
|
+
// All special values have the MSB set, so after an AND with MSBS, we
|
|
338
|
+
// are left with -128 for special values and 0 for full. After applying
|
|
339
|
+
// subs 2, we arrive at the result of -128(kEmpty) for special and
|
|
340
|
+
// -2(kDeleted) for full.
|
|
332
341
|
auto msbs = _mm_set1_epi8(static_cast<char>(-128));
|
|
333
|
-
auto
|
|
334
|
-
|
|
335
|
-
auto res = _mm_or_si128(_mm_shuffle_epi8(x126, ctrl), msbs);
|
|
336
|
-
#else
|
|
337
|
-
auto zero = _mm_setzero_si128();
|
|
338
|
-
auto special_mask = _mm_cmpgt_epi8_fixed(zero, ctrl);
|
|
339
|
-
auto res = _mm_or_si128(msbs, _mm_andnot_si128(special_mask, x126));
|
|
340
|
-
#endif
|
|
342
|
+
auto twos = _mm_set1_epi8(static_cast<char>(2));
|
|
343
|
+
auto res = _mm_subs_epi8(_mm_and_si128(msbs, ctrl), twos);
|
|
341
344
|
_mm_storeu_si128(reinterpret_cast<__m128i*>(dst), res);
|
|
342
345
|
}
|
|
343
346
|
|