@nxtedition/rocksdb 15.1.5 → 15.2.1
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/.claude/settings.local.json +5 -1
- package/binding.cc +84 -47
- package/binding.gyp +102 -2
- package/deps/abseil-cpp/BUILD.bazel +35 -0
- package/deps/abseil-cpp/CMake/AbseilDll.cmake +938 -0
- package/deps/abseil-cpp/CMake/AbseilHelpers.cmake +465 -0
- package/deps/abseil-cpp/CMake/Googletest/CMakeLists.txt.in +14 -0
- package/deps/abseil-cpp/CMake/Googletest/DownloadGTest.cmake +41 -0
- package/deps/abseil-cpp/CMake/abslConfig.cmake.in +8 -0
- package/deps/abseil-cpp/CMake/install_test_project/CMakeLists.txt +25 -0
- package/deps/abseil-cpp/CMake/install_test_project/simple.cc +32 -0
- package/deps/abseil-cpp/CMake/install_test_project/test.sh +113 -0
- package/deps/abseil-cpp/CMakeLists.txt +280 -0
- package/deps/abseil-cpp/LICENSE +203 -0
- package/deps/abseil-cpp/MODULE.bazel +43 -0
- package/deps/abseil-cpp/PrivacyInfo.xcprivacy +14 -0
- package/deps/abseil-cpp/absl/BUILD.bazel +62 -0
- package/deps/abseil-cpp/absl/CMakeLists.txt +45 -0
- package/deps/abseil-cpp/absl/abseil.podspec.gen.py +245 -0
- package/deps/abseil-cpp/absl/algorithm/BUILD.bazel +92 -0
- package/deps/abseil-cpp/absl/algorithm/CMakeLists.txt +72 -0
- package/deps/abseil-cpp/absl/algorithm/algorithm.h +64 -0
- package/deps/abseil-cpp/absl/algorithm/algorithm_test.cc +60 -0
- package/deps/abseil-cpp/absl/algorithm/container.h +1864 -0
- package/deps/abseil-cpp/absl/algorithm/container_test.cc +2232 -0
- package/deps/abseil-cpp/absl/base/BUILD.bazel +1036 -0
- package/deps/abseil-cpp/absl/base/CMakeLists.txt +881 -0
- package/deps/abseil-cpp/absl/base/attributes.h +1081 -0
- package/deps/abseil-cpp/absl/base/attributes_test.cc +43 -0
- package/deps/abseil-cpp/absl/base/bit_cast_test.cc +109 -0
- package/deps/abseil-cpp/absl/base/c_header_test.c +30 -0
- package/deps/abseil-cpp/absl/base/call_once.h +228 -0
- package/deps/abseil-cpp/absl/base/call_once_test.cc +107 -0
- package/deps/abseil-cpp/absl/base/casts.cc +61 -0
- package/deps/abseil-cpp/absl/base/casts.h +313 -0
- package/deps/abseil-cpp/absl/base/casts_test.cc +148 -0
- package/deps/abseil-cpp/absl/base/config.h +854 -0
- package/deps/abseil-cpp/absl/base/config_test.cc +60 -0
- package/deps/abseil-cpp/absl/base/const_init.h +76 -0
- package/deps/abseil-cpp/absl/base/dynamic_annotations.h +480 -0
- package/deps/abseil-cpp/absl/base/exception_safety_testing_test.cc +958 -0
- package/deps/abseil-cpp/absl/base/fast_type_id.h +73 -0
- package/deps/abseil-cpp/absl/base/fast_type_id_test.cc +130 -0
- package/deps/abseil-cpp/absl/base/internal/atomic_hook.h +200 -0
- package/deps/abseil-cpp/absl/base/internal/atomic_hook_test.cc +97 -0
- package/deps/abseil-cpp/absl/base/internal/atomic_hook_test_helper.cc +32 -0
- package/deps/abseil-cpp/absl/base/internal/atomic_hook_test_helper.h +34 -0
- package/deps/abseil-cpp/absl/base/internal/cmake_thread_test.cc +22 -0
- package/deps/abseil-cpp/absl/base/internal/cycleclock.cc +72 -0
- package/deps/abseil-cpp/absl/base/internal/cycleclock.h +144 -0
- package/deps/abseil-cpp/absl/base/internal/cycleclock_config.h +55 -0
- package/deps/abseil-cpp/absl/base/internal/direct_mmap.h +170 -0
- package/deps/abseil-cpp/absl/base/internal/dynamic_annotations.h +398 -0
- package/deps/abseil-cpp/absl/base/internal/endian.h +279 -0
- package/deps/abseil-cpp/absl/base/internal/endian_test.cc +263 -0
- package/deps/abseil-cpp/absl/base/internal/errno_saver.h +43 -0
- package/deps/abseil-cpp/absl/base/internal/errno_saver_test.cc +45 -0
- package/deps/abseil-cpp/absl/base/internal/exception_safety_testing.cc +79 -0
- package/deps/abseil-cpp/absl/base/internal/exception_safety_testing.h +1109 -0
- package/deps/abseil-cpp/absl/base/internal/exception_testing.h +42 -0
- package/deps/abseil-cpp/absl/base/internal/hide_ptr.h +51 -0
- package/deps/abseil-cpp/absl/base/internal/iterator_traits.h +75 -0
- package/deps/abseil-cpp/absl/base/internal/iterator_traits_test.cc +85 -0
- package/deps/abseil-cpp/absl/base/internal/iterator_traits_test_helper.h +97 -0
- package/deps/abseil-cpp/absl/base/internal/low_level_alloc.cc +661 -0
- package/deps/abseil-cpp/absl/base/internal/low_level_alloc.h +133 -0
- package/deps/abseil-cpp/absl/base/internal/low_level_alloc_test.cc +180 -0
- package/deps/abseil-cpp/absl/base/internal/low_level_scheduling.h +134 -0
- package/deps/abseil-cpp/absl/base/internal/nullability_traits.h +71 -0
- package/deps/abseil-cpp/absl/base/internal/nullability_traits_test.cc +98 -0
- package/deps/abseil-cpp/absl/base/internal/per_thread_tls.h +52 -0
- package/deps/abseil-cpp/absl/base/internal/poison.cc +85 -0
- package/deps/abseil-cpp/absl/base/internal/poison.h +59 -0
- package/deps/abseil-cpp/absl/base/internal/poison_test.cc +41 -0
- package/deps/abseil-cpp/absl/base/internal/pretty_function.h +33 -0
- package/deps/abseil-cpp/absl/base/internal/raw_logging.cc +279 -0
- package/deps/abseil-cpp/absl/base/internal/raw_logging.h +217 -0
- package/deps/abseil-cpp/absl/base/internal/scheduling_mode.h +58 -0
- package/deps/abseil-cpp/absl/base/internal/scoped_set_env.cc +81 -0
- package/deps/abseil-cpp/absl/base/internal/scoped_set_env.h +45 -0
- package/deps/abseil-cpp/absl/base/internal/scoped_set_env_test.cc +99 -0
- package/deps/abseil-cpp/absl/base/internal/spinlock.cc +225 -0
- package/deps/abseil-cpp/absl/base/internal/spinlock.h +310 -0
- package/deps/abseil-cpp/absl/base/internal/spinlock_akaros.inc +35 -0
- package/deps/abseil-cpp/absl/base/internal/spinlock_benchmark.cc +80 -0
- package/deps/abseil-cpp/absl/base/internal/spinlock_linux.inc +71 -0
- package/deps/abseil-cpp/absl/base/internal/spinlock_posix.inc +46 -0
- package/deps/abseil-cpp/absl/base/internal/spinlock_wait.cc +81 -0
- package/deps/abseil-cpp/absl/base/internal/spinlock_wait.h +95 -0
- package/deps/abseil-cpp/absl/base/internal/spinlock_win32.inc +40 -0
- package/deps/abseil-cpp/absl/base/internal/strerror.cc +88 -0
- package/deps/abseil-cpp/absl/base/internal/strerror.h +39 -0
- package/deps/abseil-cpp/absl/base/internal/strerror_benchmark.cc +29 -0
- package/deps/abseil-cpp/absl/base/internal/strerror_test.cc +89 -0
- package/deps/abseil-cpp/absl/base/internal/sysinfo.cc +494 -0
- package/deps/abseil-cpp/absl/base/internal/sysinfo.h +74 -0
- package/deps/abseil-cpp/absl/base/internal/sysinfo_test.cc +82 -0
- package/deps/abseil-cpp/absl/base/internal/thread_identity.cc +163 -0
- package/deps/abseil-cpp/absl/base/internal/thread_identity.h +273 -0
- package/deps/abseil-cpp/absl/base/internal/thread_identity_benchmark.cc +38 -0
- package/deps/abseil-cpp/absl/base/internal/thread_identity_test.cc +129 -0
- package/deps/abseil-cpp/absl/base/internal/throw_delegate.cc +203 -0
- package/deps/abseil-cpp/absl/base/internal/throw_delegate.h +75 -0
- package/deps/abseil-cpp/absl/base/internal/tracing.cc +39 -0
- package/deps/abseil-cpp/absl/base/internal/tracing.h +81 -0
- package/deps/abseil-cpp/absl/base/internal/tracing_strong_test.cc +117 -0
- package/deps/abseil-cpp/absl/base/internal/tracing_weak_test.cc +34 -0
- package/deps/abseil-cpp/absl/base/internal/tsan_mutex_interface.h +68 -0
- package/deps/abseil-cpp/absl/base/internal/unaligned_access.h +89 -0
- package/deps/abseil-cpp/absl/base/internal/unique_small_name_test.cc +77 -0
- package/deps/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +134 -0
- package/deps/abseil-cpp/absl/base/internal/unscaledcycleclock.h +113 -0
- package/deps/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +62 -0
- package/deps/abseil-cpp/absl/base/log_severity.cc +56 -0
- package/deps/abseil-cpp/absl/base/log_severity.h +185 -0
- package/deps/abseil-cpp/absl/base/log_severity_test.cc +251 -0
- package/deps/abseil-cpp/absl/base/macros.h +243 -0
- package/deps/abseil-cpp/absl/base/no_destructor.h +191 -0
- package/deps/abseil-cpp/absl/base/no_destructor_benchmark.cc +165 -0
- package/deps/abseil-cpp/absl/base/no_destructor_test.cc +205 -0
- package/deps/abseil-cpp/absl/base/nullability.h +317 -0
- package/deps/abseil-cpp/absl/base/nullability_default_nonnull_test.cc +44 -0
- package/deps/abseil-cpp/absl/base/nullability_test.cc +90 -0
- package/deps/abseil-cpp/absl/base/optimization.h +310 -0
- package/deps/abseil-cpp/absl/base/optimization_test.cc +141 -0
- package/deps/abseil-cpp/absl/base/options.h +158 -0
- package/deps/abseil-cpp/absl/base/policy_checks.h +115 -0
- package/deps/abseil-cpp/absl/base/port.h +25 -0
- package/deps/abseil-cpp/absl/base/prefetch.h +209 -0
- package/deps/abseil-cpp/absl/base/prefetch_test.cc +64 -0
- package/deps/abseil-cpp/absl/base/raw_logging_test.cc +98 -0
- package/deps/abseil-cpp/absl/base/spinlock_test_common.cc +302 -0
- package/deps/abseil-cpp/absl/base/thread_annotations.h +333 -0
- package/deps/abseil-cpp/absl/base/throw_delegate_test.cc +175 -0
- package/deps/abseil-cpp/absl/cleanup/BUILD.bazel +74 -0
- package/deps/abseil-cpp/absl/cleanup/CMakeLists.txt +55 -0
- package/deps/abseil-cpp/absl/cleanup/cleanup.h +142 -0
- package/deps/abseil-cpp/absl/cleanup/cleanup_test.cc +309 -0
- package/deps/abseil-cpp/absl/cleanup/internal/cleanup.h +99 -0
- package/deps/abseil-cpp/absl/container/BUILD.bazel +1394 -0
- package/deps/abseil-cpp/absl/container/CMakeLists.txt +1239 -0
- package/deps/abseil-cpp/absl/container/btree_benchmark.cc +806 -0
- package/deps/abseil-cpp/absl/container/btree_map.h +941 -0
- package/deps/abseil-cpp/absl/container/btree_set.h +872 -0
- package/deps/abseil-cpp/absl/container/btree_test.cc +3653 -0
- package/deps/abseil-cpp/absl/container/btree_test.h +166 -0
- package/deps/abseil-cpp/absl/container/chunked_queue.h +755 -0
- package/deps/abseil-cpp/absl/container/chunked_queue_benchmark.cc +386 -0
- package/deps/abseil-cpp/absl/container/chunked_queue_test.cc +768 -0
- package/deps/abseil-cpp/absl/container/fixed_array.h +547 -0
- package/deps/abseil-cpp/absl/container/fixed_array_benchmark.cc +67 -0
- package/deps/abseil-cpp/absl/container/fixed_array_exception_safety_test.cc +201 -0
- package/deps/abseil-cpp/absl/container/fixed_array_test.cc +874 -0
- package/deps/abseil-cpp/absl/container/flat_hash_map.h +702 -0
- package/deps/abseil-cpp/absl/container/flat_hash_map_test.cc +451 -0
- package/deps/abseil-cpp/absl/container/flat_hash_set.h +590 -0
- package/deps/abseil-cpp/absl/container/flat_hash_set_test.cc +401 -0
- package/deps/abseil-cpp/absl/container/hash_container_defaults.h +45 -0
- package/deps/abseil-cpp/absl/container/inlined_vector.h +1025 -0
- package/deps/abseil-cpp/absl/container/inlined_vector_benchmark.cc +829 -0
- package/deps/abseil-cpp/absl/container/inlined_vector_exception_safety_test.cc +508 -0
- package/deps/abseil-cpp/absl/container/inlined_vector_test.cc +2278 -0
- package/deps/abseil-cpp/absl/container/internal/btree.h +3149 -0
- package/deps/abseil-cpp/absl/container/internal/btree_container.h +876 -0
- package/deps/abseil-cpp/absl/container/internal/chunked_queue.h +173 -0
- package/deps/abseil-cpp/absl/container/internal/common.h +301 -0
- package/deps/abseil-cpp/absl/container/internal/common_policy_traits.h +151 -0
- package/deps/abseil-cpp/absl/container/internal/common_policy_traits_test.cc +157 -0
- package/deps/abseil-cpp/absl/container/internal/compressed_tuple.h +275 -0
- package/deps/abseil-cpp/absl/container/internal/compressed_tuple_test.cc +469 -0
- package/deps/abseil-cpp/absl/container/internal/container_memory.h +561 -0
- package/deps/abseil-cpp/absl/container/internal/container_memory_test.cc +359 -0
- package/deps/abseil-cpp/absl/container/internal/hash_function_defaults.h +281 -0
- package/deps/abseil-cpp/absl/container/internal/hash_function_defaults_test.cc +633 -0
- package/deps/abseil-cpp/absl/container/internal/hash_generator_testing.cc +54 -0
- package/deps/abseil-cpp/absl/container/internal/hash_generator_testing.h +172 -0
- package/deps/abseil-cpp/absl/container/internal/hash_policy_testing.h +173 -0
- package/deps/abseil-cpp/absl/container/internal/hash_policy_testing_test.cc +45 -0
- package/deps/abseil-cpp/absl/container/internal/hash_policy_traits.h +195 -0
- package/deps/abseil-cpp/absl/container/internal/hash_policy_traits_test.cc +149 -0
- package/deps/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +527 -0
- package/deps/abseil-cpp/absl/container/internal/hashtable_control_bytes_test.cc +259 -0
- package/deps/abseil-cpp/absl/container/internal/hashtable_debug.h +102 -0
- package/deps/abseil-cpp/absl/container/internal/hashtable_debug_hooks.h +85 -0
- package/deps/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +316 -0
- package/deps/abseil-cpp/absl/container/internal/hashtablez_sampler.h +311 -0
- package/deps/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc +31 -0
- package/deps/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc +534 -0
- package/deps/abseil-cpp/absl/container/internal/heterogeneous_lookup_testing.h +80 -0
- package/deps/abseil-cpp/absl/container/internal/inlined_vector.h +1094 -0
- package/deps/abseil-cpp/absl/container/internal/layout.h +828 -0
- package/deps/abseil-cpp/absl/container/internal/layout_benchmark.cc +295 -0
- package/deps/abseil-cpp/absl/container/internal/layout_test.cc +2034 -0
- package/deps/abseil-cpp/absl/container/internal/node_slot_policy.h +95 -0
- package/deps/abseil-cpp/absl/container/internal/node_slot_policy_test.cc +71 -0
- package/deps/abseil-cpp/absl/container/internal/raw_hash_map.h +382 -0
- package/deps/abseil-cpp/absl/container/internal/raw_hash_set.cc +2090 -0
- package/deps/abseil-cpp/absl/container/internal/raw_hash_set.h +3763 -0
- package/deps/abseil-cpp/absl/container/internal/raw_hash_set_allocator_test.cc +525 -0
- package/deps/abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc +696 -0
- package/deps/abseil-cpp/absl/container/internal/raw_hash_set_probe_benchmark.cc +583 -0
- package/deps/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl.h +79 -0
- package/deps/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl_test.cc +66 -0
- package/deps/abseil-cpp/absl/container/internal/raw_hash_set_test.cc +4184 -0
- package/deps/abseil-cpp/absl/container/internal/test_allocator.h +387 -0
- package/deps/abseil-cpp/absl/container/internal/test_instance_tracker.cc +29 -0
- package/deps/abseil-cpp/absl/container/internal/test_instance_tracker.h +274 -0
- package/deps/abseil-cpp/absl/container/internal/test_instance_tracker_test.cc +184 -0
- package/deps/abseil-cpp/absl/container/internal/tracked.h +83 -0
- package/deps/abseil-cpp/absl/container/internal/unordered_map_constructor_test.h +435 -0
- package/deps/abseil-cpp/absl/container/internal/unordered_map_lookup_test.h +112 -0
- package/deps/abseil-cpp/absl/container/internal/unordered_map_members_test.h +87 -0
- package/deps/abseil-cpp/absl/container/internal/unordered_map_modifiers_test.h +336 -0
- package/deps/abseil-cpp/absl/container/internal/unordered_map_test.cc +50 -0
- package/deps/abseil-cpp/absl/container/internal/unordered_set_constructor_test.h +437 -0
- package/deps/abseil-cpp/absl/container/internal/unordered_set_lookup_test.h +88 -0
- package/deps/abseil-cpp/absl/container/internal/unordered_set_members_test.h +86 -0
- package/deps/abseil-cpp/absl/container/internal/unordered_set_modifiers_test.h +215 -0
- package/deps/abseil-cpp/absl/container/internal/unordered_set_test.cc +41 -0
- package/deps/abseil-cpp/absl/container/linked_hash_map.h +666 -0
- package/deps/abseil-cpp/absl/container/linked_hash_map_benchmark.cc +140 -0
- package/deps/abseil-cpp/absl/container/linked_hash_map_test.cc +987 -0
- package/deps/abseil-cpp/absl/container/linked_hash_set.h +527 -0
- package/deps/abseil-cpp/absl/container/linked_hash_set_benchmark.cc +84 -0
- package/deps/abseil-cpp/absl/container/linked_hash_set_test.cc +947 -0
- package/deps/abseil-cpp/absl/container/node_hash_map.h +698 -0
- package/deps/abseil-cpp/absl/container/node_hash_map_test.cc +348 -0
- package/deps/abseil-cpp/absl/container/node_hash_set.h +589 -0
- package/deps/abseil-cpp/absl/container/node_hash_set_test.cc +188 -0
- package/deps/abseil-cpp/absl/container/sample_element_size_test.cc +118 -0
- package/deps/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake +106 -0
- package/deps/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake +303 -0
- package/deps/abseil-cpp/absl/copts/GENERATED_copts.bzl +304 -0
- package/deps/abseil-cpp/absl/copts/configure_copts.bzl +39 -0
- package/deps/abseil-cpp/absl/copts/copts.py +205 -0
- package/deps/abseil-cpp/absl/copts/generate_copts.py +109 -0
- package/deps/abseil-cpp/absl/crc/BUILD.bazel +228 -0
- package/deps/abseil-cpp/absl/crc/CMakeLists.txt +177 -0
- package/deps/abseil-cpp/absl/crc/crc32c.cc +95 -0
- package/deps/abseil-cpp/absl/crc/crc32c.h +192 -0
- package/deps/abseil-cpp/absl/crc/crc32c_benchmark.cc +196 -0
- package/deps/abseil-cpp/absl/crc/crc32c_test.cc +257 -0
- package/deps/abseil-cpp/absl/crc/internal/cpu_detect.cc +359 -0
- package/deps/abseil-cpp/absl/crc/internal/cpu_detect.h +69 -0
- package/deps/abseil-cpp/absl/crc/internal/crc.cc +435 -0
- package/deps/abseil-cpp/absl/crc/internal/crc.h +83 -0
- package/deps/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +278 -0
- package/deps/abseil-cpp/absl/crc/internal/crc32c.h +39 -0
- package/deps/abseil-cpp/absl/crc/internal/crc32c_inline.h +72 -0
- package/deps/abseil-cpp/absl/crc/internal/crc_cord_state.cc +131 -0
- package/deps/abseil-cpp/absl/crc/internal/crc_cord_state.h +159 -0
- package/deps/abseil-cpp/absl/crc/internal/crc_cord_state_test.cc +124 -0
- package/deps/abseil-cpp/absl/crc/internal/crc_internal.h +161 -0
- package/deps/abseil-cpp/absl/crc/internal/crc_memcpy.h +122 -0
- package/deps/abseil-cpp/absl/crc/internal/crc_memcpy_fallback.cc +78 -0
- package/deps/abseil-cpp/absl/crc/internal/crc_memcpy_test.cc +177 -0
- package/deps/abseil-cpp/absl/crc/internal/crc_memcpy_x86_arm_combined.cc +459 -0
- package/deps/abseil-cpp/absl/crc/internal/crc_non_temporal_memcpy.cc +93 -0
- package/deps/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +762 -0
- package/deps/abseil-cpp/absl/crc/internal/gen_crc32c_consts.py +90 -0
- package/deps/abseil-cpp/absl/crc/internal/non_temporal_arm_intrinsics.h +81 -0
- package/deps/abseil-cpp/absl/crc/internal/non_temporal_memcpy.h +195 -0
- package/deps/abseil-cpp/absl/crc/internal/non_temporal_memcpy_test.cc +90 -0
- package/deps/abseil-cpp/absl/debugging/BUILD.bazel +483 -0
- package/deps/abseil-cpp/absl/debugging/CMakeLists.txt +448 -0
- package/deps/abseil-cpp/absl/debugging/failure_signal_handler.cc +434 -0
- package/deps/abseil-cpp/absl/debugging/failure_signal_handler.h +121 -0
- package/deps/abseil-cpp/absl/debugging/failure_signal_handler_test.cc +166 -0
- package/deps/abseil-cpp/absl/debugging/internal/address_is_readable.cc +98 -0
- package/deps/abseil-cpp/absl/debugging/internal/address_is_readable.h +32 -0
- package/deps/abseil-cpp/absl/debugging/internal/addresses.h +57 -0
- package/deps/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer.cc +118 -0
- package/deps/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer.h +71 -0
- package/deps/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer_test.cc +97 -0
- package/deps/abseil-cpp/absl/debugging/internal/bounded_utf8_length_sequence.h +126 -0
- package/deps/abseil-cpp/absl/debugging/internal/bounded_utf8_length_sequence_test.cc +126 -0
- package/deps/abseil-cpp/absl/debugging/internal/decode_rust_punycode.cc +258 -0
- package/deps/abseil-cpp/absl/debugging/internal/decode_rust_punycode.h +55 -0
- package/deps/abseil-cpp/absl/debugging/internal/decode_rust_punycode_test.cc +606 -0
- package/deps/abseil-cpp/absl/debugging/internal/demangle.cc +2958 -0
- package/deps/abseil-cpp/absl/debugging/internal/demangle.h +76 -0
- package/deps/abseil-cpp/absl/debugging/internal/demangle_rust.cc +925 -0
- package/deps/abseil-cpp/absl/debugging/internal/demangle_rust.h +42 -0
- package/deps/abseil-cpp/absl/debugging/internal/demangle_rust_test.cc +584 -0
- package/deps/abseil-cpp/absl/debugging/internal/demangle_test.cc +2050 -0
- package/deps/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +413 -0
- package/deps/abseil-cpp/absl/debugging/internal/elf_mem_image.h +141 -0
- package/deps/abseil-cpp/absl/debugging/internal/examine_stack.cc +334 -0
- package/deps/abseil-cpp/absl/debugging/internal/examine_stack.h +70 -0
- package/deps/abseil-cpp/absl/debugging/internal/stack_consumption.cc +206 -0
- package/deps/abseil-cpp/absl/debugging/internal/stack_consumption.h +50 -0
- package/deps/abseil-cpp/absl/debugging/internal/stack_consumption_test.cc +50 -0
- package/deps/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +288 -0
- package/deps/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +148 -0
- package/deps/abseil-cpp/absl/debugging/internal/stacktrace_config.h +96 -0
- package/deps/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +112 -0
- package/deps/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +114 -0
- package/deps/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +270 -0
- package/deps/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +204 -0
- package/deps/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc +25 -0
- package/deps/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +81 -0
- package/deps/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +410 -0
- package/deps/abseil-cpp/absl/debugging/internal/symbolize.h +153 -0
- package/deps/abseil-cpp/absl/debugging/internal/utf8_for_code_point.cc +70 -0
- package/deps/abseil-cpp/absl/debugging/internal/utf8_for_code_point.h +47 -0
- package/deps/abseil-cpp/absl/debugging/internal/utf8_for_code_point_test.cc +175 -0
- package/deps/abseil-cpp/absl/debugging/internal/vdso_support.cc +209 -0
- package/deps/abseil-cpp/absl/debugging/internal/vdso_support.h +158 -0
- package/deps/abseil-cpp/absl/debugging/leak_check.cc +73 -0
- package/deps/abseil-cpp/absl/debugging/leak_check.h +150 -0
- package/deps/abseil-cpp/absl/debugging/leak_check_fail_test.cc +41 -0
- package/deps/abseil-cpp/absl/debugging/leak_check_test.cc +41 -0
- package/deps/abseil-cpp/absl/debugging/stacktrace.cc +244 -0
- package/deps/abseil-cpp/absl/debugging/stacktrace.h +302 -0
- package/deps/abseil-cpp/absl/debugging/stacktrace_benchmark.cc +78 -0
- package/deps/abseil-cpp/absl/debugging/stacktrace_test.cc +505 -0
- package/deps/abseil-cpp/absl/debugging/symbolize.cc +44 -0
- package/deps/abseil-cpp/absl/debugging/symbolize.h +99 -0
- package/deps/abseil-cpp/absl/debugging/symbolize_darwin.inc +102 -0
- package/deps/abseil-cpp/absl/debugging/symbolize_elf.inc +1756 -0
- package/deps/abseil-cpp/absl/debugging/symbolize_emscripten.inc +63 -0
- package/deps/abseil-cpp/absl/debugging/symbolize_test.cc +619 -0
- package/deps/abseil-cpp/absl/debugging/symbolize_unimplemented.inc +40 -0
- package/deps/abseil-cpp/absl/debugging/symbolize_win32.inc +99 -0
- package/deps/abseil-cpp/absl/extend/CMakeLists.txt +140 -0
- package/deps/abseil-cpp/absl/extend/internal/BUILD.bazel +127 -0
- package/deps/abseil-cpp/absl/extend/internal/aggregate.h +1687 -0
- package/deps/abseil-cpp/absl/extend/internal/aggregate_test.cc +867 -0
- package/deps/abseil-cpp/absl/extend/internal/dependencies.h +83 -0
- package/deps/abseil-cpp/absl/extend/internal/dependencies_test.cc +117 -0
- package/deps/abseil-cpp/absl/extend/internal/is_tuple_hashable.h +45 -0
- package/deps/abseil-cpp/absl/extend/internal/num_bases.h +87 -0
- package/deps/abseil-cpp/absl/extend/internal/num_bases_test.cc +91 -0
- package/deps/abseil-cpp/absl/extend/internal/num_initializers.h +113 -0
- package/deps/abseil-cpp/absl/extend/internal/num_initializers_test.cc +250 -0
- package/deps/abseil-cpp/absl/extend/internal/reflection.cc +112 -0
- package/deps/abseil-cpp/absl/extend/internal/reflection.h +75 -0
- package/deps/abseil-cpp/absl/extend/internal/tuple.h +51 -0
- package/deps/abseil-cpp/absl/flags/BUILD.bazel +618 -0
- package/deps/abseil-cpp/absl/flags/CMakeLists.txt +482 -0
- package/deps/abseil-cpp/absl/flags/commandlineflag.cc +35 -0
- package/deps/abseil-cpp/absl/flags/commandlineflag.h +219 -0
- package/deps/abseil-cpp/absl/flags/commandlineflag_test.cc +236 -0
- package/deps/abseil-cpp/absl/flags/config.h +68 -0
- package/deps/abseil-cpp/absl/flags/config_test.cc +61 -0
- package/deps/abseil-cpp/absl/flags/declare.h +77 -0
- package/deps/abseil-cpp/absl/flags/flag.h +307 -0
- package/deps/abseil-cpp/absl/flags/flag_benchmark.cc +251 -0
- package/deps/abseil-cpp/absl/flags/flag_benchmark.lds +13 -0
- package/deps/abseil-cpp/absl/flags/flag_test.cc +1381 -0
- package/deps/abseil-cpp/absl/flags/flag_test_defs.cc +24 -0
- package/deps/abseil-cpp/absl/flags/internal/commandlineflag.cc +26 -0
- package/deps/abseil-cpp/absl/flags/internal/commandlineflag.h +68 -0
- package/deps/abseil-cpp/absl/flags/internal/flag.cc +712 -0
- package/deps/abseil-cpp/absl/flags/internal/flag.h +969 -0
- package/deps/abseil-cpp/absl/flags/internal/parse.h +70 -0
- package/deps/abseil-cpp/absl/flags/internal/path_util.h +62 -0
- package/deps/abseil-cpp/absl/flags/internal/path_util_test.cc +46 -0
- package/deps/abseil-cpp/absl/flags/internal/private_handle_accessor.cc +69 -0
- package/deps/abseil-cpp/absl/flags/internal/private_handle_accessor.h +64 -0
- package/deps/abseil-cpp/absl/flags/internal/program_name.cc +61 -0
- package/deps/abseil-cpp/absl/flags/internal/program_name.h +50 -0
- package/deps/abseil-cpp/absl/flags/internal/program_name_test.cc +61 -0
- package/deps/abseil-cpp/absl/flags/internal/registry.h +98 -0
- package/deps/abseil-cpp/absl/flags/internal/sequence_lock.h +187 -0
- package/deps/abseil-cpp/absl/flags/internal/sequence_lock_test.cc +169 -0
- package/deps/abseil-cpp/absl/flags/internal/usage.cc +558 -0
- package/deps/abseil-cpp/absl/flags/internal/usage.h +106 -0
- package/deps/abseil-cpp/absl/flags/internal/usage_test.cc +550 -0
- package/deps/abseil-cpp/absl/flags/marshalling.cc +276 -0
- package/deps/abseil-cpp/absl/flags/marshalling.h +361 -0
- package/deps/abseil-cpp/absl/flags/marshalling_test.cc +1220 -0
- package/deps/abseil-cpp/absl/flags/parse.cc +952 -0
- package/deps/abseil-cpp/absl/flags/parse.h +130 -0
- package/deps/abseil-cpp/absl/flags/parse_test.cc +1094 -0
- package/deps/abseil-cpp/absl/flags/reflection.cc +368 -0
- package/deps/abseil-cpp/absl/flags/reflection.h +90 -0
- package/deps/abseil-cpp/absl/flags/reflection_test.cc +268 -0
- package/deps/abseil-cpp/absl/flags/usage.cc +66 -0
- package/deps/abseil-cpp/absl/flags/usage.h +43 -0
- package/deps/abseil-cpp/absl/flags/usage_config.cc +170 -0
- package/deps/abseil-cpp/absl/flags/usage_config.h +135 -0
- package/deps/abseil-cpp/absl/flags/usage_config_test.cc +205 -0
- package/deps/abseil-cpp/absl/functional/BUILD.bazel +173 -0
- package/deps/abseil-cpp/absl/functional/CMakeLists.txt +140 -0
- package/deps/abseil-cpp/absl/functional/any_invocable.h +336 -0
- package/deps/abseil-cpp/absl/functional/any_invocable_test.cc +1687 -0
- package/deps/abseil-cpp/absl/functional/bind_front.h +200 -0
- package/deps/abseil-cpp/absl/functional/bind_front_test.cc +227 -0
- package/deps/abseil-cpp/absl/functional/function_ref.h +249 -0
- package/deps/abseil-cpp/absl/functional/function_ref_test.cc +416 -0
- package/deps/abseil-cpp/absl/functional/function_type_benchmark.cc +176 -0
- package/deps/abseil-cpp/absl/functional/internal/any_invocable.h +787 -0
- package/deps/abseil-cpp/absl/functional/internal/front_binder.h +93 -0
- package/deps/abseil-cpp/absl/functional/internal/function_ref.h +151 -0
- package/deps/abseil-cpp/absl/functional/overload.h +72 -0
- package/deps/abseil-cpp/absl/functional/overload_test.cc +207 -0
- package/deps/abseil-cpp/absl/hash/BUILD.bazel +220 -0
- package/deps/abseil-cpp/absl/hash/CMakeLists.txt +179 -0
- package/deps/abseil-cpp/absl/hash/hash.h +466 -0
- package/deps/abseil-cpp/absl/hash/hash_benchmark.cc +398 -0
- package/deps/abseil-cpp/absl/hash/hash_instantiated_test.cc +224 -0
- package/deps/abseil-cpp/absl/hash/hash_test.cc +1320 -0
- package/deps/abseil-cpp/absl/hash/hash_testing.h +380 -0
- package/deps/abseil-cpp/absl/hash/internal/city.cc +337 -0
- package/deps/abseil-cpp/absl/hash/internal/city.h +78 -0
- package/deps/abseil-cpp/absl/hash/internal/city_test.cc +597 -0
- package/deps/abseil-cpp/absl/hash/internal/hash.cc +430 -0
- package/deps/abseil-cpp/absl/hash/internal/hash.h +1563 -0
- package/deps/abseil-cpp/absl/hash/internal/hash_test.h +87 -0
- package/deps/abseil-cpp/absl/hash/internal/low_level_hash_test.cc +509 -0
- package/deps/abseil-cpp/absl/hash/internal/print_hash_of.cc +23 -0
- package/deps/abseil-cpp/absl/hash/internal/spy_hash_state.h +286 -0
- package/deps/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h +38 -0
- package/deps/abseil-cpp/absl/log/BUILD.bazel +686 -0
- package/deps/abseil-cpp/absl/log/CMakeLists.txt +1239 -0
- package/deps/abseil-cpp/absl/log/absl_check.h +117 -0
- package/deps/abseil-cpp/absl/log/absl_check_test.cc +58 -0
- package/deps/abseil-cpp/absl/log/absl_log.h +115 -0
- package/deps/abseil-cpp/absl/log/absl_log_basic_test.cc +22 -0
- package/deps/abseil-cpp/absl/log/absl_vlog_is_on.h +95 -0
- package/deps/abseil-cpp/absl/log/check.h +210 -0
- package/deps/abseil-cpp/absl/log/check_test.cc +58 -0
- package/deps/abseil-cpp/absl/log/check_test_impl.inc +1035 -0
- package/deps/abseil-cpp/absl/log/die_if_null.cc +34 -0
- package/deps/abseil-cpp/absl/log/die_if_null.h +97 -0
- package/deps/abseil-cpp/absl/log/die_if_null_test.cc +107 -0
- package/deps/abseil-cpp/absl/log/flags.cc +143 -0
- package/deps/abseil-cpp/absl/log/flags.h +43 -0
- package/deps/abseil-cpp/absl/log/flags_test.cc +195 -0
- package/deps/abseil-cpp/absl/log/globals.cc +178 -0
- package/deps/abseil-cpp/absl/log/globals.h +230 -0
- package/deps/abseil-cpp/absl/log/globals_test.cc +156 -0
- package/deps/abseil-cpp/absl/log/initialize.cc +38 -0
- package/deps/abseil-cpp/absl/log/initialize.h +45 -0
- package/deps/abseil-cpp/absl/log/internal/BUILD.bazel +581 -0
- package/deps/abseil-cpp/absl/log/internal/append_truncated.h +75 -0
- package/deps/abseil-cpp/absl/log/internal/check_impl.h +151 -0
- package/deps/abseil-cpp/absl/log/internal/check_op.cc +147 -0
- package/deps/abseil-cpp/absl/log/internal/check_op.h +565 -0
- package/deps/abseil-cpp/absl/log/internal/conditions.cc +85 -0
- package/deps/abseil-cpp/absl/log/internal/conditions.h +247 -0
- package/deps/abseil-cpp/absl/log/internal/config.h +45 -0
- package/deps/abseil-cpp/absl/log/internal/container.h +312 -0
- package/deps/abseil-cpp/absl/log/internal/container_test.cc +254 -0
- package/deps/abseil-cpp/absl/log/internal/flags.h +59 -0
- package/deps/abseil-cpp/absl/log/internal/fnmatch.cc +73 -0
- package/deps/abseil-cpp/absl/log/internal/fnmatch.h +35 -0
- package/deps/abseil-cpp/absl/log/internal/fnmatch_benchmark.cc +29 -0
- package/deps/abseil-cpp/absl/log/internal/fnmatch_test.cc +60 -0
- package/deps/abseil-cpp/absl/log/internal/globals.cc +145 -0
- package/deps/abseil-cpp/absl/log/internal/globals.h +101 -0
- package/deps/abseil-cpp/absl/log/internal/log_format.cc +205 -0
- package/deps/abseil-cpp/absl/log/internal/log_format.h +78 -0
- package/deps/abseil-cpp/absl/log/internal/log_impl.h +280 -0
- package/deps/abseil-cpp/absl/log/internal/log_message.cc +787 -0
- package/deps/abseil-cpp/absl/log/internal/log_message.h +455 -0
- package/deps/abseil-cpp/absl/log/internal/log_sink_set.cc +296 -0
- package/deps/abseil-cpp/absl/log/internal/log_sink_set.h +54 -0
- package/deps/abseil-cpp/absl/log/internal/nullguard.cc +35 -0
- package/deps/abseil-cpp/absl/log/internal/nullguard.h +88 -0
- package/deps/abseil-cpp/absl/log/internal/nullstream.h +128 -0
- package/deps/abseil-cpp/absl/log/internal/proto.cc +218 -0
- package/deps/abseil-cpp/absl/log/internal/proto.h +298 -0
- package/deps/abseil-cpp/absl/log/internal/stderr_log_sink_test.cc +105 -0
- package/deps/abseil-cpp/absl/log/internal/strip.h +99 -0
- package/deps/abseil-cpp/absl/log/internal/structured.h +160 -0
- package/deps/abseil-cpp/absl/log/internal/structured_proto.cc +115 -0
- package/deps/abseil-cpp/absl/log/internal/structured_proto.h +107 -0
- package/deps/abseil-cpp/absl/log/internal/structured_proto_test.cc +120 -0
- package/deps/abseil-cpp/absl/log/internal/test_actions.cc +75 -0
- package/deps/abseil-cpp/absl/log/internal/test_actions.h +90 -0
- package/deps/abseil-cpp/absl/log/internal/test_helpers.cc +82 -0
- package/deps/abseil-cpp/absl/log/internal/test_helpers.h +71 -0
- package/deps/abseil-cpp/absl/log/internal/test_matchers.cc +216 -0
- package/deps/abseil-cpp/absl/log/internal/test_matchers.h +94 -0
- package/deps/abseil-cpp/absl/log/internal/vlog_config.cc +347 -0
- package/deps/abseil-cpp/absl/log/internal/vlog_config.h +164 -0
- package/deps/abseil-cpp/absl/log/internal/vlog_config_benchmark.cc +187 -0
- package/deps/abseil-cpp/absl/log/internal/voidify.h +50 -0
- package/deps/abseil-cpp/absl/log/log.h +378 -0
- package/deps/abseil-cpp/absl/log/log_basic_test.cc +22 -0
- package/deps/abseil-cpp/absl/log/log_basic_test_impl.inc +654 -0
- package/deps/abseil-cpp/absl/log/log_benchmark.cc +164 -0
- package/deps/abseil-cpp/absl/log/log_entry.cc +263 -0
- package/deps/abseil-cpp/absl/log/log_entry.h +223 -0
- package/deps/abseil-cpp/absl/log/log_entry_test.cc +468 -0
- package/deps/abseil-cpp/absl/log/log_format_test.cc +2261 -0
- package/deps/abseil-cpp/absl/log/log_macro_hygiene_test.cc +187 -0
- package/deps/abseil-cpp/absl/log/log_modifier_methods_test.cc +244 -0
- package/deps/abseil-cpp/absl/log/log_sink.cc +23 -0
- package/deps/abseil-cpp/absl/log/log_sink.h +71 -0
- package/deps/abseil-cpp/absl/log/log_sink_registry.h +64 -0
- package/deps/abseil-cpp/absl/log/log_sink_test.cc +418 -0
- package/deps/abseil-cpp/absl/log/log_streamer.h +181 -0
- package/deps/abseil-cpp/absl/log/log_streamer_test.cc +451 -0
- package/deps/abseil-cpp/absl/log/scoped_mock_log.cc +86 -0
- package/deps/abseil-cpp/absl/log/scoped_mock_log.h +203 -0
- package/deps/abseil-cpp/absl/log/scoped_mock_log_test.cc +295 -0
- package/deps/abseil-cpp/absl/log/stripping_test.cc +502 -0
- package/deps/abseil-cpp/absl/log/structured.h +75 -0
- package/deps/abseil-cpp/absl/log/structured_test.cc +64 -0
- package/deps/abseil-cpp/absl/log/vlog_is_on.h +74 -0
- package/deps/abseil-cpp/absl/log/vlog_is_on_test.cc +233 -0
- package/deps/abseil-cpp/absl/memory/BUILD.bazel +62 -0
- package/deps/abseil-cpp/absl/memory/CMakeLists.txt +41 -0
- package/deps/abseil-cpp/absl/memory/memory.h +278 -0
- package/deps/abseil-cpp/absl/memory/memory_test.cc +222 -0
- package/deps/abseil-cpp/absl/meta/BUILD.bazel +112 -0
- package/deps/abseil-cpp/absl/meta/CMakeLists.txt +100 -0
- package/deps/abseil-cpp/absl/meta/internal/constexpr_testing.h +73 -0
- package/deps/abseil-cpp/absl/meta/internal/constexpr_testing_test.cc +40 -0
- package/deps/abseil-cpp/absl/meta/internal/requires.h +67 -0
- package/deps/abseil-cpp/absl/meta/internal/requires_test.cc +66 -0
- package/deps/abseil-cpp/absl/meta/type_traits.h +582 -0
- package/deps/abseil-cpp/absl/meta/type_traits_test.cc +378 -0
- package/deps/abseil-cpp/absl/numeric/BUILD.bazel +145 -0
- package/deps/abseil-cpp/absl/numeric/CMakeLists.txt +104 -0
- package/deps/abseil-cpp/absl/numeric/bits.h +262 -0
- package/deps/abseil-cpp/absl/numeric/bits_benchmark.cc +73 -0
- package/deps/abseil-cpp/absl/numeric/bits_test.cc +724 -0
- package/deps/abseil-cpp/absl/numeric/int128.cc +344 -0
- package/deps/abseil-cpp/absl/numeric/int128.h +1224 -0
- package/deps/abseil-cpp/absl/numeric/int128_benchmark.cc +281 -0
- package/deps/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +303 -0
- package/deps/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +347 -0
- package/deps/abseil-cpp/absl/numeric/int128_stream_test.cc +1400 -0
- package/deps/abseil-cpp/absl/numeric/int128_test.cc +1407 -0
- package/deps/abseil-cpp/absl/numeric/internal/bits.h +394 -0
- package/deps/abseil-cpp/absl/numeric/internal/representation.h +55 -0
- package/deps/abseil-cpp/absl/profiling/BUILD.bazel +188 -0
- package/deps/abseil-cpp/absl/profiling/CMakeLists.txt +132 -0
- package/deps/abseil-cpp/absl/profiling/hashtable.cc +135 -0
- package/deps/abseil-cpp/absl/profiling/hashtable.h +40 -0
- package/deps/abseil-cpp/absl/profiling/internal/exponential_biased.cc +93 -0
- package/deps/abseil-cpp/absl/profiling/internal/exponential_biased.h +130 -0
- package/deps/abseil-cpp/absl/profiling/internal/exponential_biased_test.cc +203 -0
- package/deps/abseil-cpp/absl/profiling/internal/periodic_sampler.cc +53 -0
- package/deps/abseil-cpp/absl/profiling/internal/periodic_sampler.h +211 -0
- package/deps/abseil-cpp/absl/profiling/internal/periodic_sampler_benchmark.cc +79 -0
- package/deps/abseil-cpp/absl/profiling/internal/periodic_sampler_test.cc +177 -0
- package/deps/abseil-cpp/absl/profiling/internal/profile_builder.cc +463 -0
- package/deps/abseil-cpp/absl/profiling/internal/profile_builder.h +161 -0
- package/deps/abseil-cpp/absl/profiling/internal/sample_recorder.h +253 -0
- package/deps/abseil-cpp/absl/profiling/internal/sample_recorder_test.cc +188 -0
- package/deps/abseil-cpp/absl/random/BUILD.bazel +550 -0
- package/deps/abseil-cpp/absl/random/CMakeLists.txt +1250 -0
- package/deps/abseil-cpp/absl/random/benchmarks.cc +376 -0
- package/deps/abseil-cpp/absl/random/bernoulli_distribution.h +202 -0
- package/deps/abseil-cpp/absl/random/bernoulli_distribution_test.cc +217 -0
- package/deps/abseil-cpp/absl/random/beta_distribution.h +429 -0
- package/deps/abseil-cpp/absl/random/beta_distribution_test.cc +615 -0
- package/deps/abseil-cpp/absl/random/bit_gen_ref.h +187 -0
- package/deps/abseil-cpp/absl/random/bit_gen_ref_test.cc +107 -0
- package/deps/abseil-cpp/absl/random/discrete_distribution.cc +108 -0
- package/deps/abseil-cpp/absl/random/discrete_distribution.h +249 -0
- package/deps/abseil-cpp/absl/random/discrete_distribution_test.cc +251 -0
- package/deps/abseil-cpp/absl/random/distributions.h +450 -0
- package/deps/abseil-cpp/absl/random/distributions_test.cc +516 -0
- package/deps/abseil-cpp/absl/random/examples_test.cc +98 -0
- package/deps/abseil-cpp/absl/random/exponential_distribution.h +166 -0
- package/deps/abseil-cpp/absl/random/exponential_distribution_test.cc +426 -0
- package/deps/abseil-cpp/absl/random/gaussian_distribution.cc +104 -0
- package/deps/abseil-cpp/absl/random/gaussian_distribution.h +276 -0
- package/deps/abseil-cpp/absl/random/gaussian_distribution_test.cc +561 -0
- package/deps/abseil-cpp/absl/random/generators_test.cc +185 -0
- package/deps/abseil-cpp/absl/random/internal/BUILD.bazel +863 -0
- package/deps/abseil-cpp/absl/random/internal/chi_square.cc +230 -0
- package/deps/abseil-cpp/absl/random/internal/chi_square.h +89 -0
- package/deps/abseil-cpp/absl/random/internal/chi_square_test.cc +364 -0
- package/deps/abseil-cpp/absl/random/internal/distribution_caller.h +96 -0
- package/deps/abseil-cpp/absl/random/internal/distribution_test_util.cc +418 -0
- package/deps/abseil-cpp/absl/random/internal/distribution_test_util.h +113 -0
- package/deps/abseil-cpp/absl/random/internal/distribution_test_util_test.cc +193 -0
- package/deps/abseil-cpp/absl/random/internal/entropy_pool.cc +185 -0
- package/deps/abseil-cpp/absl/random/internal/entropy_pool.h +35 -0
- package/deps/abseil-cpp/absl/random/internal/entropy_pool_test.cc +119 -0
- package/deps/abseil-cpp/absl/random/internal/explicit_seed_seq.h +92 -0
- package/deps/abseil-cpp/absl/random/internal/explicit_seed_seq_test.cc +241 -0
- package/deps/abseil-cpp/absl/random/internal/fast_uniform_bits.h +271 -0
- package/deps/abseil-cpp/absl/random/internal/fast_uniform_bits_test.cc +336 -0
- package/deps/abseil-cpp/absl/random/internal/fastmath.h +57 -0
- package/deps/abseil-cpp/absl/random/internal/fastmath_test.cc +95 -0
- package/deps/abseil-cpp/absl/random/internal/gaussian_distribution_gentables.cc +142 -0
- package/deps/abseil-cpp/absl/random/internal/generate_real.h +144 -0
- package/deps/abseil-cpp/absl/random/internal/generate_real_test.cc +496 -0
- package/deps/abseil-cpp/absl/random/internal/iostream_state_saver.h +248 -0
- package/deps/abseil-cpp/absl/random/internal/iostream_state_saver_test.cc +373 -0
- package/deps/abseil-cpp/absl/random/internal/mock_helpers.h +160 -0
- package/deps/abseil-cpp/absl/random/internal/mock_overload_set.h +122 -0
- package/deps/abseil-cpp/absl/random/internal/mock_validators.h +98 -0
- package/deps/abseil-cpp/absl/random/internal/nanobenchmark.cc +804 -0
- package/deps/abseil-cpp/absl/random/internal/nanobenchmark.h +172 -0
- package/deps/abseil-cpp/absl/random/internal/nanobenchmark_test.cc +79 -0
- package/deps/abseil-cpp/absl/random/internal/nonsecure_base.h +160 -0
- package/deps/abseil-cpp/absl/random/internal/nonsecure_base_test.cc +267 -0
- package/deps/abseil-cpp/absl/random/internal/pcg_engine.h +287 -0
- package/deps/abseil-cpp/absl/random/internal/pcg_engine_test.cc +638 -0
- package/deps/abseil-cpp/absl/random/internal/platform.h +158 -0
- package/deps/abseil-cpp/absl/random/internal/randen.cc +91 -0
- package/deps/abseil-cpp/absl/random/internal/randen.h +96 -0
- package/deps/abseil-cpp/absl/random/internal/randen_benchmarks.cc +177 -0
- package/deps/abseil-cpp/absl/random/internal/randen_detect.cc +280 -0
- package/deps/abseil-cpp/absl/random/internal/randen_detect.h +33 -0
- package/deps/abseil-cpp/absl/random/internal/randen_engine.h +265 -0
- package/deps/abseil-cpp/absl/random/internal/randen_engine_test.cc +654 -0
- package/deps/abseil-cpp/absl/random/internal/randen_hwaes.cc +526 -0
- package/deps/abseil-cpp/absl/random/internal/randen_hwaes.h +50 -0
- package/deps/abseil-cpp/absl/random/internal/randen_hwaes_test.cc +99 -0
- package/deps/abseil-cpp/absl/random/internal/randen_round_keys.cc +462 -0
- package/deps/abseil-cpp/absl/random/internal/randen_slow.cc +471 -0
- package/deps/abseil-cpp/absl/random/internal/randen_slow.h +40 -0
- package/deps/abseil-cpp/absl/random/internal/randen_slow_test.cc +61 -0
- package/deps/abseil-cpp/absl/random/internal/randen_test.cc +75 -0
- package/deps/abseil-cpp/absl/random/internal/randen_traits.h +88 -0
- package/deps/abseil-cpp/absl/random/internal/salted_seed_seq.h +165 -0
- package/deps/abseil-cpp/absl/random/internal/salted_seed_seq_test.cc +172 -0
- package/deps/abseil-cpp/absl/random/internal/seed_material.cc +249 -0
- package/deps/abseil-cpp/absl/random/internal/seed_material.h +104 -0
- package/deps/abseil-cpp/absl/random/internal/seed_material_test.cc +205 -0
- package/deps/abseil-cpp/absl/random/internal/sequence_urbg.h +60 -0
- package/deps/abseil-cpp/absl/random/internal/traits.h +149 -0
- package/deps/abseil-cpp/absl/random/internal/traits_test.cc +123 -0
- package/deps/abseil-cpp/absl/random/internal/uniform_helper.h +244 -0
- package/deps/abseil-cpp/absl/random/internal/uniform_helper_test.cc +279 -0
- package/deps/abseil-cpp/absl/random/internal/wide_multiply.h +95 -0
- package/deps/abseil-cpp/absl/random/internal/wide_multiply_test.cc +119 -0
- package/deps/abseil-cpp/absl/random/log_uniform_int_distribution.h +253 -0
- package/deps/abseil-cpp/absl/random/log_uniform_int_distribution_test.cc +277 -0
- package/deps/abseil-cpp/absl/random/mock_distributions.h +269 -0
- package/deps/abseil-cpp/absl/random/mock_distributions_test.cc +281 -0
- package/deps/abseil-cpp/absl/random/mocking_bit_gen.h +237 -0
- package/deps/abseil-cpp/absl/random/mocking_bit_gen_test.cc +403 -0
- package/deps/abseil-cpp/absl/random/poisson_distribution.h +262 -0
- package/deps/abseil-cpp/absl/random/poisson_distribution_test.cc +569 -0
- package/deps/abseil-cpp/absl/random/random.h +224 -0
- package/deps/abseil-cpp/absl/random/seed_gen_exception.cc +45 -0
- package/deps/abseil-cpp/absl/random/seed_gen_exception.h +55 -0
- package/deps/abseil-cpp/absl/random/seed_sequences.cc +33 -0
- package/deps/abseil-cpp/absl/random/seed_sequences.h +112 -0
- package/deps/abseil-cpp/absl/random/seed_sequences_test.cc +126 -0
- package/deps/abseil-cpp/absl/random/uniform_int_distribution.h +276 -0
- package/deps/abseil-cpp/absl/random/uniform_int_distribution_test.cc +259 -0
- package/deps/abseil-cpp/absl/random/uniform_real_distribution.h +204 -0
- package/deps/abseil-cpp/absl/random/uniform_real_distribution_test.cc +394 -0
- package/deps/abseil-cpp/absl/random/zipf_distribution.h +273 -0
- package/deps/abseil-cpp/absl/random/zipf_distribution_test.cc +423 -0
- package/deps/abseil-cpp/absl/status/BUILD.bazel +211 -0
- package/deps/abseil-cpp/absl/status/CMakeLists.txt +159 -0
- package/deps/abseil-cpp/absl/status/internal/status_internal.cc +251 -0
- package/deps/abseil-cpp/absl/status/internal/status_internal.h +133 -0
- package/deps/abseil-cpp/absl/status/internal/status_matchers.cc +69 -0
- package/deps/abseil-cpp/absl/status/internal/status_matchers.h +246 -0
- package/deps/abseil-cpp/absl/status/internal/statusor_internal.h +657 -0
- package/deps/abseil-cpp/absl/status/status.cc +421 -0
- package/deps/abseil-cpp/absl/status/status.h +948 -0
- package/deps/abseil-cpp/absl/status/status_benchmark.cc +37 -0
- package/deps/abseil-cpp/absl/status/status_matchers.h +166 -0
- package/deps/abseil-cpp/absl/status/status_matchers_test.cc +211 -0
- package/deps/abseil-cpp/absl/status/status_payload_printer.cc +36 -0
- package/deps/abseil-cpp/absl/status/status_payload_printer.h +52 -0
- package/deps/abseil-cpp/absl/status/status_test.cc +580 -0
- package/deps/abseil-cpp/absl/status/statusor.cc +106 -0
- package/deps/abseil-cpp/absl/status/statusor.h +743 -0
- package/deps/abseil-cpp/absl/status/statusor_benchmark.cc +480 -0
- package/deps/abseil-cpp/absl/status/statusor_test.cc +2124 -0
- package/deps/abseil-cpp/absl/strings/BUILD.bazel +1593 -0
- package/deps/abseil-cpp/absl/strings/CMakeLists.txt +1295 -0
- package/deps/abseil-cpp/absl/strings/ascii.cc +296 -0
- package/deps/abseil-cpp/absl/strings/ascii.h +289 -0
- package/deps/abseil-cpp/absl/strings/ascii_benchmark.cc +157 -0
- package/deps/abseil-cpp/absl/strings/ascii_test.cc +374 -0
- package/deps/abseil-cpp/absl/strings/atod_manual_test.cc +193 -0
- package/deps/abseil-cpp/absl/strings/char_formatting_test.cc +169 -0
- package/deps/abseil-cpp/absl/strings/charconv.cc +1442 -0
- package/deps/abseil-cpp/absl/strings/charconv.h +123 -0
- package/deps/abseil-cpp/absl/strings/charconv_benchmark.cc +203 -0
- package/deps/abseil-cpp/absl/strings/charconv_test.cc +787 -0
- package/deps/abseil-cpp/absl/strings/charset.h +163 -0
- package/deps/abseil-cpp/absl/strings/charset_benchmark.cc +57 -0
- package/deps/abseil-cpp/absl/strings/charset_test.cc +181 -0
- package/deps/abseil-cpp/absl/strings/cord.cc +1582 -0
- package/deps/abseil-cpp/absl/strings/cord.h +1763 -0
- package/deps/abseil-cpp/absl/strings/cord_analysis.cc +196 -0
- package/deps/abseil-cpp/absl/strings/cord_analysis.h +63 -0
- package/deps/abseil-cpp/absl/strings/cord_buffer.h +572 -0
- package/deps/abseil-cpp/absl/strings/cord_buffer_test.cc +322 -0
- package/deps/abseil-cpp/absl/strings/cord_test.cc +3421 -0
- package/deps/abseil-cpp/absl/strings/cord_test_helpers.h +122 -0
- package/deps/abseil-cpp/absl/strings/cordz_test.cc +468 -0
- package/deps/abseil-cpp/absl/strings/cordz_test_helpers.h +152 -0
- package/deps/abseil-cpp/absl/strings/escaping.cc +1035 -0
- package/deps/abseil-cpp/absl/strings/escaping.h +185 -0
- package/deps/abseil-cpp/absl/strings/escaping_benchmark.cc +124 -0
- package/deps/abseil-cpp/absl/strings/escaping_test.cc +760 -0
- package/deps/abseil-cpp/absl/strings/has_absl_stringify.h +64 -0
- package/deps/abseil-cpp/absl/strings/has_absl_stringify_test.cc +40 -0
- package/deps/abseil-cpp/absl/strings/has_ostream_operator.h +42 -0
- package/deps/abseil-cpp/absl/strings/has_ostream_operator_test.cc +41 -0
- package/deps/abseil-cpp/absl/strings/internal/append_and_overwrite.h +93 -0
- package/deps/abseil-cpp/absl/strings/internal/append_and_overwrite_test.cc +95 -0
- package/deps/abseil-cpp/absl/strings/internal/charconv_bigint.cc +357 -0
- package/deps/abseil-cpp/absl/strings/internal/charconv_bigint.h +433 -0
- package/deps/abseil-cpp/absl/strings/internal/charconv_bigint_test.cc +260 -0
- package/deps/abseil-cpp/absl/strings/internal/charconv_parse.cc +504 -0
- package/deps/abseil-cpp/absl/strings/internal/charconv_parse.h +99 -0
- package/deps/abseil-cpp/absl/strings/internal/charconv_parse_test.cc +357 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_data_edge.h +63 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_data_edge_test.cc +130 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_internal.cc +70 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_internal.h +942 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +1237 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_btree.h +944 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +187 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +267 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator_test.cc +346 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +69 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +212 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_btree_reader_test.cc +293 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_btree_test.cc +1568 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +64 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_consume.h +47 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +56 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_crc.h +103 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_crc_test.cc +130 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_flat.h +195 -0
- package/deps/abseil-cpp/absl/strings/internal/cord_rep_test_util.h +205 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_functions.cc +102 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_functions.h +87 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_functions_test.cc +147 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_handle.cc +165 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_handle.h +98 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_handle_test.cc +265 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_info.cc +424 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_info.h +295 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_info_statistics_test.cc +510 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_info_test.cc +342 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_sample_token.cc +64 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_sample_token.h +97 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_sample_token_test.cc +208 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_statistics.h +88 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_update_scope.h +71 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_update_scope_test.cc +49 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +123 -0
- package/deps/abseil-cpp/absl/strings/internal/cordz_update_tracker_test.cc +147 -0
- package/deps/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +99 -0
- package/deps/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +35 -0
- package/deps/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance_benchmark.cc +56 -0
- package/deps/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance_test.cc +99 -0
- package/deps/abseil-cpp/absl/strings/internal/escaping.cc +209 -0
- package/deps/abseil-cpp/absl/strings/internal/escaping.h +59 -0
- package/deps/abseil-cpp/absl/strings/internal/escaping_test_common.h +133 -0
- package/deps/abseil-cpp/absl/strings/internal/generic_printer.cc +107 -0
- package/deps/abseil-cpp/absl/strings/internal/generic_printer.h +115 -0
- package/deps/abseil-cpp/absl/strings/internal/generic_printer_internal.h +423 -0
- package/deps/abseil-cpp/absl/strings/internal/generic_printer_test.cc +685 -0
- package/deps/abseil-cpp/absl/strings/internal/memutil.cc +48 -0
- package/deps/abseil-cpp/absl/strings/internal/memutil.h +40 -0
- package/deps/abseil-cpp/absl/strings/internal/memutil_benchmark.cc +127 -0
- package/deps/abseil-cpp/absl/strings/internal/memutil_test.cc +41 -0
- package/deps/abseil-cpp/absl/strings/internal/numbers_test_common.h +184 -0
- package/deps/abseil-cpp/absl/strings/internal/ostringstream.cc +43 -0
- package/deps/abseil-cpp/absl/strings/internal/ostringstream.h +114 -0
- package/deps/abseil-cpp/absl/strings/internal/ostringstream_benchmark.cc +105 -0
- package/deps/abseil-cpp/absl/strings/internal/ostringstream_test.cc +131 -0
- package/deps/abseil-cpp/absl/strings/internal/pow10_helper.cc +122 -0
- package/deps/abseil-cpp/absl/strings/internal/pow10_helper.h +40 -0
- package/deps/abseil-cpp/absl/strings/internal/pow10_helper_test.cc +122 -0
- package/deps/abseil-cpp/absl/strings/internal/resize_uninitialized.h +119 -0
- package/deps/abseil-cpp/absl/strings/internal/resize_uninitialized_test.cc +108 -0
- package/deps/abseil-cpp/absl/strings/internal/stl_type_traits.h +248 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/arg.cc +615 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/arg.h +661 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/arg_test.cc +162 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/bind.cc +275 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/bind.h +237 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/bind_test.cc +157 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/checker.h +98 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/checker_test.cc +176 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +357 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/convert_test.cc +1471 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/extension.cc +53 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/extension.h +456 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/extension_test.cc +110 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +1945 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +37 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/output.cc +74 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/output.h +97 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/output_test.cc +79 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/parser.cc +140 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/parser.h +271 -0
- package/deps/abseil-cpp/absl/strings/internal/str_format/parser_test.cc +446 -0
- package/deps/abseil-cpp/absl/strings/internal/str_join_internal.h +341 -0
- package/deps/abseil-cpp/absl/strings/internal/str_split_internal.h +525 -0
- package/deps/abseil-cpp/absl/strings/internal/string_constant.h +67 -0
- package/deps/abseil-cpp/absl/strings/internal/string_constant_test.cc +60 -0
- package/deps/abseil-cpp/absl/strings/internal/stringify_sink.cc +28 -0
- package/deps/abseil-cpp/absl/strings/internal/stringify_sink.h +57 -0
- package/deps/abseil-cpp/absl/strings/internal/utf8.cc +148 -0
- package/deps/abseil-cpp/absl/strings/internal/utf8.h +64 -0
- package/deps/abseil-cpp/absl/strings/internal/utf8_test.cc +259 -0
- package/deps/abseil-cpp/absl/strings/match.cc +133 -0
- package/deps/abseil-cpp/absl/strings/match.h +129 -0
- package/deps/abseil-cpp/absl/strings/match_test.cc +291 -0
- package/deps/abseil-cpp/absl/strings/numbers.cc +1230 -0
- package/deps/abseil-cpp/absl/strings/numbers.h +359 -0
- package/deps/abseil-cpp/absl/strings/numbers_benchmark.cc +288 -0
- package/deps/abseil-cpp/absl/strings/numbers_test.cc +2324 -0
- package/deps/abseil-cpp/absl/strings/resize_and_overwrite.h +194 -0
- package/deps/abseil-cpp/absl/strings/resize_and_overwrite_test.cc +154 -0
- package/deps/abseil-cpp/absl/strings/str_cat.cc +247 -0
- package/deps/abseil-cpp/absl/strings/str_cat.h +633 -0
- package/deps/abseil-cpp/absl/strings/str_cat_benchmark.cc +288 -0
- package/deps/abseil-cpp/absl/strings/str_cat_test.cc +692 -0
- package/deps/abseil-cpp/absl/strings/str_format.h +887 -0
- package/deps/abseil-cpp/absl/strings/str_format_test.cc +1230 -0
- package/deps/abseil-cpp/absl/strings/str_join.h +301 -0
- package/deps/abseil-cpp/absl/strings/str_join_benchmark.cc +106 -0
- package/deps/abseil-cpp/absl/strings/str_join_test.cc +645 -0
- package/deps/abseil-cpp/absl/strings/str_replace.cc +91 -0
- package/deps/abseil-cpp/absl/strings/str_replace.h +222 -0
- package/deps/abseil-cpp/absl/strings/str_replace_benchmark.cc +121 -0
- package/deps/abseil-cpp/absl/strings/str_replace_test.cc +345 -0
- package/deps/abseil-cpp/absl/strings/str_split.cc +144 -0
- package/deps/abseil-cpp/absl/strings/str_split.h +582 -0
- package/deps/abseil-cpp/absl/strings/str_split_benchmark.cc +180 -0
- package/deps/abseil-cpp/absl/strings/str_split_test.cc +1069 -0
- package/deps/abseil-cpp/absl/strings/string_view.h +60 -0
- package/deps/abseil-cpp/absl/strings/string_view_test.cc +86 -0
- package/deps/abseil-cpp/absl/strings/strip.h +99 -0
- package/deps/abseil-cpp/absl/strings/strip_test.cc +198 -0
- package/deps/abseil-cpp/absl/strings/substitute.cc +187 -0
- package/deps/abseil-cpp/absl/strings/substitute.h +769 -0
- package/deps/abseil-cpp/absl/strings/substitute_benchmark.cc +158 -0
- package/deps/abseil-cpp/absl/strings/substitute_test.cc +288 -0
- package/deps/abseil-cpp/absl/synchronization/BUILD.bazel +410 -0
- package/deps/abseil-cpp/absl/synchronization/CMakeLists.txt +293 -0
- package/deps/abseil-cpp/absl/synchronization/barrier.cc +52 -0
- package/deps/abseil-cpp/absl/synchronization/barrier.h +79 -0
- package/deps/abseil-cpp/absl/synchronization/barrier_test.cc +75 -0
- package/deps/abseil-cpp/absl/synchronization/blocking_counter.cc +73 -0
- package/deps/abseil-cpp/absl/synchronization/blocking_counter.h +107 -0
- package/deps/abseil-cpp/absl/synchronization/blocking_counter_benchmark.cc +84 -0
- package/deps/abseil-cpp/absl/synchronization/blocking_counter_test.cc +146 -0
- package/deps/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +152 -0
- package/deps/abseil-cpp/absl/synchronization/internal/create_thread_identity.h +56 -0
- package/deps/abseil-cpp/absl/synchronization/internal/futex.h +177 -0
- package/deps/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +107 -0
- package/deps/abseil-cpp/absl/synchronization/internal/futex_waiter.h +63 -0
- package/deps/abseil-cpp/absl/synchronization/internal/graphcycles.cc +714 -0
- package/deps/abseil-cpp/absl/synchronization/internal/graphcycles.h +146 -0
- package/deps/abseil-cpp/absl/synchronization/internal/graphcycles_benchmark.cc +43 -0
- package/deps/abseil-cpp/absl/synchronization/internal/graphcycles_test.cc +483 -0
- package/deps/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +220 -0
- package/deps/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +178 -0
- package/deps/abseil-cpp/absl/synchronization/internal/kernel_timeout_test.cc +406 -0
- package/deps/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +106 -0
- package/deps/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +119 -0
- package/deps/abseil-cpp/absl/synchronization/internal/per_thread_sem_test.cc +194 -0
- package/deps/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +163 -0
- package/deps/abseil-cpp/absl/synchronization/internal/pthread_waiter.h +60 -0
- package/deps/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +118 -0
- package/deps/abseil-cpp/absl/synchronization/internal/sem_waiter.h +65 -0
- package/deps/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +87 -0
- package/deps/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.h +56 -0
- package/deps/abseil-cpp/absl/synchronization/internal/thread_pool.h +96 -0
- package/deps/abseil-cpp/absl/synchronization/internal/waiter.h +69 -0
- package/deps/abseil-cpp/absl/synchronization/internal/waiter_base.cc +38 -0
- package/deps/abseil-cpp/absl/synchronization/internal/waiter_base.h +90 -0
- package/deps/abseil-cpp/absl/synchronization/internal/waiter_test.cc +192 -0
- package/deps/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +147 -0
- package/deps/abseil-cpp/absl/synchronization/internal/win32_waiter.h +72 -0
- package/deps/abseil-cpp/absl/synchronization/lifetime_test.cc +180 -0
- package/deps/abseil-cpp/absl/synchronization/mutex.cc +2820 -0
- package/deps/abseil-cpp/absl/synchronization/mutex.h +1352 -0
- package/deps/abseil-cpp/absl/synchronization/mutex_benchmark.cc +321 -0
- package/deps/abseil-cpp/absl/synchronization/mutex_method_pointer_test.cc +138 -0
- package/deps/abseil-cpp/absl/synchronization/mutex_test.cc +2065 -0
- package/deps/abseil-cpp/absl/synchronization/notification.cc +85 -0
- package/deps/abseil-cpp/absl/synchronization/notification.h +133 -0
- package/deps/abseil-cpp/absl/synchronization/notification_test.cc +230 -0
- package/deps/abseil-cpp/absl/time/BUILD.bazel +244 -0
- package/deps/abseil-cpp/absl/time/CMakeLists.txt +218 -0
- package/deps/abseil-cpp/absl/time/civil_time.cc +200 -0
- package/deps/abseil-cpp/absl/time/civil_time.h +589 -0
- package/deps/abseil-cpp/absl/time/civil_time_benchmark.cc +129 -0
- package/deps/abseil-cpp/absl/time/civil_time_test.cc +1351 -0
- package/deps/abseil-cpp/absl/time/clock.cc +603 -0
- package/deps/abseil-cpp/absl/time/clock.h +78 -0
- package/deps/abseil-cpp/absl/time/clock_benchmark.cc +74 -0
- package/deps/abseil-cpp/absl/time/clock_interface.cc +71 -0
- package/deps/abseil-cpp/absl/time/clock_interface.h +91 -0
- package/deps/abseil-cpp/absl/time/clock_interface_test.cc +128 -0
- package/deps/abseil-cpp/absl/time/clock_test.cc +122 -0
- package/deps/abseil-cpp/absl/time/duration.cc +918 -0
- package/deps/abseil-cpp/absl/time/duration_benchmark.cc +608 -0
- package/deps/abseil-cpp/absl/time/duration_test.cc +1901 -0
- package/deps/abseil-cpp/absl/time/flag_test.cc +147 -0
- package/deps/abseil-cpp/absl/time/format.cc +162 -0
- package/deps/abseil-cpp/absl/time/format_benchmark.cc +64 -0
- package/deps/abseil-cpp/absl/time/format_test.cc +441 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/BUILD.bazel +195 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h +332 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +644 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +460 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/include/cctz/zone_info_source.h +102 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/cctz_benchmark.cc +436 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/civil_time_detail.cc +94 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/civil_time_test.cc +1066 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/test_time_zone_names.cc +515 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/test_time_zone_names.h +33 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +140 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.h +52 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +1068 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_format_test.cc +1773 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc +47 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +80 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc +115 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h +97 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +1070 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h +128 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +333 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h +60 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +217 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc +918 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.cc +186 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.h +37 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.cc +159 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.h +132 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +120 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +116 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/README.zoneinfo +38 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/version +1 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Abidjan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Accra +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Addis_Ababa +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Algiers +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Asmara +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Asmera +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Bamako +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Bangui +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Banjul +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Bissau +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Blantyre +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Brazzaville +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Bujumbura +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Cairo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Casablanca +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Ceuta +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Conakry +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Dakar +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Dar_es_Salaam +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Djibouti +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Douala +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/El_Aaiun +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Freetown +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Gaborone +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Harare +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Johannesburg +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Juba +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Kampala +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Khartoum +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Kigali +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Kinshasa +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Lagos +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Libreville +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Lome +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Luanda +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Lubumbashi +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Lusaka +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Malabo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Maputo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Maseru +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Mbabane +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Mogadishu +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Monrovia +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Nairobi +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Ndjamena +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Niamey +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Nouakchott +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Ouagadougou +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Porto-Novo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Sao_Tome +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Timbuktu +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Tripoli +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Tunis +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Africa/Windhoek +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Adak +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Anchorage +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Anguilla +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Antigua +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Araguaina +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/Buenos_Aires +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/Catamarca +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/ComodRivadavia +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/Cordoba +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/Jujuy +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/La_Rioja +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/Mendoza +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/Rio_Gallegos +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/Salta +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/San_Juan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/San_Luis +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/Tucuman +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Argentina/Ushuaia +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Aruba +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Asuncion +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Atikokan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Atka +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Bahia +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Bahia_Banderas +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Barbados +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Belem +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Belize +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Blanc-Sablon +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Boa_Vista +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Bogota +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Boise +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Buenos_Aires +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Cambridge_Bay +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Campo_Grande +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Cancun +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Caracas +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Catamarca +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Cayenne +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Cayman +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Chicago +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Chihuahua +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Ciudad_Juarez +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Coral_Harbour +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Cordoba +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Costa_Rica +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Coyhaique +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Creston +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Cuiaba +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Curacao +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Danmarkshavn +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Dawson +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Dawson_Creek +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Denver +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Detroit +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Dominica +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Edmonton +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Eirunepe +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/El_Salvador +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Ensenada +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Fort_Nelson +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Fort_Wayne +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Fortaleza +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Glace_Bay +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Godthab +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Goose_Bay +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Grand_Turk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Grenada +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Guadeloupe +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Guatemala +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Guayaquil +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Guyana +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Halifax +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Havana +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Hermosillo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Indiana/Indianapolis +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Indiana/Knox +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Indiana/Marengo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Indiana/Petersburg +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Indiana/Tell_City +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Indiana/Vevay +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Indiana/Vincennes +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Indiana/Winamac +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Indianapolis +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Inuvik +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Iqaluit +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Jamaica +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Jujuy +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Juneau +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Kentucky/Louisville +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Kentucky/Monticello +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Knox_IN +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Kralendijk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/La_Paz +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Lima +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Los_Angeles +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Louisville +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Lower_Princes +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Maceio +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Managua +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Manaus +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Marigot +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Martinique +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Matamoros +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Mazatlan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Mendoza +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Menominee +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Merida +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Metlakatla +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Mexico_City +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Miquelon +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Moncton +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Monterrey +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Montevideo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Montreal +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Montserrat +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Nassau +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/New_York +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Nipigon +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Nome +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Noronha +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/North_Dakota/Beulah +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/North_Dakota/Center +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/North_Dakota/New_Salem +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Nuuk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Ojinaga +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Panama +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Pangnirtung +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Paramaribo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Phoenix +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Port-au-Prince +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Port_of_Spain +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Porto_Acre +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Porto_Velho +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Puerto_Rico +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Punta_Arenas +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Rainy_River +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Rankin_Inlet +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Recife +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Regina +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Resolute +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Rio_Branco +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Rosario +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Santa_Isabel +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Santarem +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Santiago +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Santo_Domingo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Sao_Paulo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Scoresbysund +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Shiprock +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Sitka +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/St_Barthelemy +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/St_Johns +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/St_Kitts +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/St_Lucia +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/St_Thomas +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/St_Vincent +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Swift_Current +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Tegucigalpa +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Thule +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Thunder_Bay +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Tijuana +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Toronto +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Tortola +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Vancouver +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Virgin +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Whitehorse +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Winnipeg +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Yakutat +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Yellowknife +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/Casey +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/Davis +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/DumontDUrville +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/Macquarie +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/Mawson +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/McMurdo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/Palmer +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/Rothera +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/South_Pole +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/Syowa +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/Troll +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Antarctica/Vostok +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Arctic/Longyearbyen +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Aden +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Almaty +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Amman +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Anadyr +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Aqtau +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Aqtobe +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Ashgabat +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Ashkhabad +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Atyrau +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Baghdad +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Bahrain +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Baku +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Bangkok +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Barnaul +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Beirut +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Bishkek +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Brunei +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Calcutta +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Chita +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Choibalsan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Chongqing +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Chungking +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Colombo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Dacca +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Damascus +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Dhaka +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Dili +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Dubai +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Dushanbe +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Famagusta +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Gaza +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Harbin +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Hebron +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Ho_Chi_Minh +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Hong_Kong +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Hovd +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Irkutsk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Istanbul +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Jakarta +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Jayapura +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Jerusalem +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Kabul +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Kamchatka +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Karachi +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Kashgar +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Kathmandu +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Katmandu +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Khandyga +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Kolkata +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Krasnoyarsk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Kuala_Lumpur +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Kuching +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Kuwait +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Macao +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Macau +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Magadan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Makassar +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Manila +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Muscat +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Nicosia +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Novokuznetsk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Novosibirsk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Omsk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Oral +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Phnom_Penh +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Pontianak +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Pyongyang +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Qatar +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Qostanay +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Qyzylorda +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Rangoon +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Riyadh +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Saigon +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Sakhalin +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Samarkand +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Seoul +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Shanghai +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Singapore +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Srednekolymsk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Taipei +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tashkent +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tbilisi +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tehran +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tel_Aviv +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Thimbu +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Thimphu +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tokyo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tomsk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Ujung_Pandang +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Ulaanbaatar +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Ulan_Bator +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Urumqi +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Ust-Nera +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Vientiane +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Vladivostok +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Yakutsk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Yangon +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Yekaterinburg +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Yerevan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/Azores +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/Bermuda +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/Canary +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/Cape_Verde +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/Faeroe +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/Faroe +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/Jan_Mayen +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/Madeira +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/Reykjavik +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/South_Georgia +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/St_Helena +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Atlantic/Stanley +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/ACT +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Adelaide +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Brisbane +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Broken_Hill +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Canberra +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Currie +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Darwin +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Eucla +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Hobart +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/LHI +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Lindeman +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Lord_Howe +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Melbourne +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/NSW +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/North +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Perth +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Queensland +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/South +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Sydney +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Tasmania +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Victoria +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/West +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Australia/Yancowinna +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Brazil/Acre +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Brazil/DeNoronha +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Brazil/East +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Brazil/West +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/CET +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/CST6CDT +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Canada/Atlantic +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Canada/Central +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Canada/Eastern +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Canada/Mountain +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Canada/Newfoundland +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Canada/Pacific +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Canada/Saskatchewan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Canada/Yukon +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Chile/Continental +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Chile/EasterIsland +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Cuba +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/EET +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/EST +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/EST5EDT +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Egypt +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Eire +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+0 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+1 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+10 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+11 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+12 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+2 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+3 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+4 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+5 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+6 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+7 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+8 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT+9 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-0 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-1 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-10 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-11 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-12 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-13 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-14 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-2 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-3 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-4 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-5 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-6 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-7 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-8 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT-9 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/GMT0 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/Greenwich +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/UCT +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/UTC +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/Universal +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Etc/Zulu +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Amsterdam +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Andorra +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Astrakhan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Athens +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Belfast +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Belgrade +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Berlin +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Bratislava +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Brussels +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Bucharest +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Budapest +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Busingen +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Chisinau +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Copenhagen +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Dublin +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Gibraltar +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Guernsey +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Helsinki +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Isle_of_Man +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Istanbul +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Jersey +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Kaliningrad +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Kiev +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Kirov +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Kyiv +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Lisbon +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Ljubljana +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/London +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Luxembourg +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Madrid +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Malta +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Mariehamn +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Minsk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Monaco +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Moscow +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Nicosia +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Oslo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Paris +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Podgorica +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Prague +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Riga +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Rome +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Samara +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/San_Marino +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Sarajevo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Saratov +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Simferopol +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Skopje +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Sofia +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Stockholm +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Tallinn +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Tirane +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Tiraspol +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Ulyanovsk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Uzhgorod +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Vaduz +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Vatican +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Vienna +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Vilnius +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Volgograd +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Warsaw +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Zagreb +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Zaporozhye +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Zurich +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Factory +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/GB +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/GB-Eire +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/GMT +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/GMT+0 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/GMT-0 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/GMT0 +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Greenwich +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/HST +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Hongkong +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Iceland +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Antananarivo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Chagos +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Christmas +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Cocos +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Comoro +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Kerguelen +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Mahe +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Maldives +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Mauritius +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Mayotte +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Indian/Reunion +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Iran +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Israel +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Jamaica +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Japan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Kwajalein +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Libya +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/MET +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/MST +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/MST7MDT +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Mexico/BajaNorte +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Mexico/BajaSur +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Mexico/General +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/NZ +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/NZ-CHAT +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Navajo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/PRC +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/PST8PDT +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Apia +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Auckland +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Bougainville +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Chatham +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Chuuk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Easter +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Efate +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Enderbury +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Fakaofo +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Fiji +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Funafuti +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Galapagos +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Gambier +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Guadalcanal +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Guam +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Honolulu +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Johnston +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Kanton +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Kiritimati +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Kosrae +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Kwajalein +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Majuro +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Marquesas +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Midway +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Nauru +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Niue +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Norfolk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Noumea +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Pago_Pago +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Palau +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Pitcairn +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Pohnpei +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Ponape +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Port_Moresby +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Rarotonga +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Saipan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Samoa +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Tahiti +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Tarawa +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Tongatapu +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Truk +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Wake +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Wallis +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Pacific/Yap +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Poland +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Portugal +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/ROC +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/ROK +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Singapore +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Turkey +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/UCT +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Alaska +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Aleutian +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Arizona +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Central +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/East-Indiana +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Eastern +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Hawaii +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Indiana-Starke +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Michigan +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Mountain +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Pacific +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/US/Samoa +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/UTC +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Universal +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/W-SU +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/WET +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Zulu +0 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/iso3166.tab +279 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zone1970.tab +375 -0
- package/deps/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zonenow.tab +296 -0
- package/deps/abseil-cpp/absl/time/internal/get_current_time_chrono.inc +31 -0
- package/deps/abseil-cpp/absl/time/internal/get_current_time_posix.inc +24 -0
- package/deps/abseil-cpp/absl/time/internal/test_util.cc +32 -0
- package/deps/abseil-cpp/absl/time/internal/test_util.h +33 -0
- package/deps/abseil-cpp/absl/time/simulated_clock.cc +225 -0
- package/deps/abseil-cpp/absl/time/simulated_clock.h +108 -0
- package/deps/abseil-cpp/absl/time/simulated_clock_test.cc +614 -0
- package/deps/abseil-cpp/absl/time/time.cc +507 -0
- package/deps/abseil-cpp/absl/time/time.h +1926 -0
- package/deps/abseil-cpp/absl/time/time_benchmark.cc +321 -0
- package/deps/abseil-cpp/absl/time/time_test.cc +1365 -0
- package/deps/abseil-cpp/absl/time/time_zone_test.cc +97 -0
- package/deps/abseil-cpp/absl/types/BUILD.bazel +166 -0
- package/deps/abseil-cpp/absl/types/CMakeLists.txt +179 -0
- package/deps/abseil-cpp/absl/types/any.h +44 -0
- package/deps/abseil-cpp/absl/types/compare.h +506 -0
- package/deps/abseil-cpp/absl/types/compare_test.cc +300 -0
- package/deps/abseil-cpp/absl/types/internal/span.h +141 -0
- package/deps/abseil-cpp/absl/types/optional.h +41 -0
- package/deps/abseil-cpp/absl/types/span.h +830 -0
- package/deps/abseil-cpp/absl/types/span_test.cc +915 -0
- package/deps/abseil-cpp/absl/types/variant.h +82 -0
- package/deps/abseil-cpp/absl/types/variant_test.cc +164 -0
- package/deps/abseil-cpp/absl/utility/BUILD.bazel +46 -0
- package/deps/abseil-cpp/absl/utility/CMakeLists.txt +28 -0
- package/deps/abseil-cpp/absl/utility/utility.h +68 -0
- package/deps/abseil-cpp/ci/absl_alternate_options.h +28 -0
- package/deps/abseil-cpp/ci/cmake_common.sh +19 -0
- package/deps/abseil-cpp/ci/cmake_install_test.sh +64 -0
- package/deps/abseil-cpp/ci/linux_arm_clang-latest_libcxx_bazel.sh +106 -0
- package/deps/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh +114 -0
- package/deps/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh +107 -0
- package/deps/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh +106 -0
- package/deps/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh +104 -0
- package/deps/abseil-cpp/ci/linux_docker_containers.sh +22 -0
- package/deps/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh +100 -0
- package/deps/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh +105 -0
- package/deps/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh +85 -0
- package/deps/abseil-cpp/ci/linux_gcc_alpine_cmake.sh +85 -0
- package/deps/abseil-cpp/ci/macos_xcode_bazel.sh +70 -0
- package/deps/abseil-cpp/ci/macos_xcode_cmake.sh +78 -0
- package/deps/abseil-cpp/ci/windows_clangcl_bazel.bat +70 -0
- package/deps/abseil-cpp/ci/windows_msvc_bazel.bat +61 -0
- package/deps/abseil-cpp/ci/windows_msvc_cmake.bat +69 -0
- package/deps/abseil-cpp/conanfile.py +51 -0
- package/deps/abseil-cpp/create_lts.py +139 -0
- package/deps/re2/.bazelrc +20 -0
- package/deps/re2/.bcr/metadata.template.json +16 -0
- package/deps/re2/.bcr/presubmit.yml +57 -0
- package/deps/re2/.bcr/source.template.json +5 -0
- package/deps/re2/BUILD.bazel +463 -0
- package/deps/re2/CMakeLists.txt +283 -0
- package/deps/re2/LICENSE +27 -0
- package/deps/re2/MODULE.bazel +29 -0
- package/deps/re2/Makefile +408 -0
- package/deps/re2/WORKSPACE.bazel +7 -0
- package/deps/re2/WORKSPACE.bzlmod +7 -0
- package/deps/re2/app/BUILD.bazel +24 -0
- package/deps/re2/app/_re2.cc +94 -0
- package/deps/re2/app/_re2.d.ts +23 -0
- package/deps/re2/app/app.ts +111 -0
- package/deps/re2/app/build.sh +32 -0
- package/deps/re2/app/index.html +5 -0
- package/deps/re2/app/package.json +14 -0
- package/deps/re2/app/rollup.config.js +28 -0
- package/deps/re2/app/tsconfig.json +17 -0
- package/deps/re2/benchlog/benchplot.py +98 -0
- package/deps/re2/benchlog/mktable +155 -0
- package/deps/re2/doc/mksyntaxgo +42 -0
- package/deps/re2/doc/mksyntaxhtml +42 -0
- package/deps/re2/doc/mksyntaxwiki +36 -0
- package/deps/re2/doc/syntax.html +477 -0
- package/deps/re2/doc/syntax.txt +463 -0
- package/deps/re2/lib/git/commit-msg.hook +104 -0
- package/deps/re2/libre2.symbols +16 -0
- package/deps/re2/libre2.symbols.darwin +12 -0
- package/deps/re2/python/BUILD.bazel +80 -0
- package/deps/re2/python/_re2.cc +352 -0
- package/deps/re2/python/re2.py +583 -0
- package/deps/re2/python/re2_test.py +495 -0
- package/deps/re2/python/setup.py +159 -0
- package/deps/re2/python/toolchains/generate.py +100 -0
- package/deps/re2/re2/bitmap256.cc +43 -0
- package/deps/re2/re2/bitmap256.h +88 -0
- package/deps/re2/re2/bitstate.cc +389 -0
- package/deps/re2/re2/compile.cc +1265 -0
- package/deps/re2/re2/dfa.cc +2135 -0
- package/deps/re2/re2/filtered_re2.cc +138 -0
- package/deps/re2/re2/filtered_re2.h +115 -0
- package/deps/re2/re2/fuzzing/re2_fuzzer.cc +284 -0
- package/deps/re2/re2/make_perl_groups.pl +116 -0
- package/deps/re2/re2/make_unicode_casefold.py +151 -0
- package/deps/re2/re2/make_unicode_groups.py +117 -0
- package/deps/re2/re2/mimics_pcre.cc +196 -0
- package/deps/re2/re2/nfa.cc +714 -0
- package/deps/re2/re2/onepass.cc +623 -0
- package/deps/re2/re2/parse.cc +2529 -0
- package/deps/re2/re2/perl_groups.cc +119 -0
- package/deps/re2/re2/pod_array.h +55 -0
- package/deps/re2/re2/prefilter.cc +711 -0
- package/deps/re2/re2/prefilter.h +168 -0
- package/deps/re2/re2/prefilter_tree.cc +376 -0
- package/deps/re2/re2/prefilter_tree.h +153 -0
- package/deps/re2/re2/prog.cc +1181 -0
- package/deps/re2/re2/prog.h +493 -0
- package/deps/re2/re2/re2.cc +1355 -0
- package/deps/re2/re2/re2.h +1074 -0
- package/deps/re2/re2/regexp.cc +1004 -0
- package/deps/re2/re2/regexp.h +693 -0
- package/deps/re2/re2/set.cc +185 -0
- package/deps/re2/re2/set.h +91 -0
- package/deps/re2/re2/simplify.cc +689 -0
- package/deps/re2/re2/sparse_array.h +394 -0
- package/deps/re2/re2/sparse_set.h +266 -0
- package/deps/re2/re2/stringpiece.h +18 -0
- package/deps/re2/re2/testing/backtrack.cc +274 -0
- package/deps/re2/re2/testing/charclass_test.cc +228 -0
- package/deps/re2/re2/testing/compile_test.cc +431 -0
- package/deps/re2/re2/testing/dfa_test.cc +376 -0
- package/deps/re2/re2/testing/dump.cc +172 -0
- package/deps/re2/re2/testing/exhaustive1_test.cc +40 -0
- package/deps/re2/re2/testing/exhaustive2_test.cc +72 -0
- package/deps/re2/re2/testing/exhaustive3_test.cc +100 -0
- package/deps/re2/re2/testing/exhaustive_test.cc +35 -0
- package/deps/re2/re2/testing/exhaustive_tester.cc +204 -0
- package/deps/re2/re2/testing/exhaustive_tester.h +105 -0
- package/deps/re2/re2/testing/filtered_re2_test.cc +343 -0
- package/deps/re2/re2/testing/mimics_pcre_test.cc +79 -0
- package/deps/re2/re2/testing/null_walker.cc +48 -0
- package/deps/re2/re2/testing/parse_test.cc +586 -0
- package/deps/re2/re2/testing/possible_match_test.cc +251 -0
- package/deps/re2/re2/testing/random_test.cc +102 -0
- package/deps/re2/re2/testing/re2_arg_test.cc +182 -0
- package/deps/re2/re2/testing/re2_test.cc +1699 -0
- package/deps/re2/re2/testing/regexp_benchmark.cc +1605 -0
- package/deps/re2/re2/testing/regexp_generator.cc +284 -0
- package/deps/re2/re2/testing/regexp_generator.h +77 -0
- package/deps/re2/re2/testing/regexp_test.cc +87 -0
- package/deps/re2/re2/testing/required_prefix_test.cc +201 -0
- package/deps/re2/re2/testing/search_test.cc +338 -0
- package/deps/re2/re2/testing/set_test.cc +235 -0
- package/deps/re2/re2/testing/simplify_test.cc +289 -0
- package/deps/re2/re2/testing/string_generator.cc +144 -0
- package/deps/re2/re2/testing/string_generator.h +76 -0
- package/deps/re2/re2/testing/string_generator_test.cc +114 -0
- package/deps/re2/re2/testing/tester.cc +690 -0
- package/deps/re2/re2/testing/tester.h +121 -0
- package/deps/re2/re2/tostring.cc +351 -0
- package/deps/re2/re2/unicode.py +284 -0
- package/deps/re2/re2/unicode_casefold.cc +604 -0
- package/deps/re2/re2/unicode_casefold.h +77 -0
- package/deps/re2/re2/unicode_groups.cc +6517 -0
- package/deps/re2/re2/unicode_groups.h +66 -0
- package/deps/re2/re2/walker-inl.h +249 -0
- package/deps/re2/re2.pc.in +9 -0
- package/deps/re2/re2Config.cmake.in +26 -0
- package/deps/re2/runtests +33 -0
- package/deps/re2/testinstall.cc +27 -0
- package/deps/re2/ucs2.diff +567 -0
- package/deps/re2/util/malloc_counter.h +19 -0
- package/deps/re2/util/pcre.cc +957 -0
- package/deps/re2/util/pcre.h +671 -0
- package/deps/re2/util/rune.cc +260 -0
- package/deps/re2/util/strutil.cc +26 -0
- package/deps/re2/util/strutil.h +16 -0
- package/deps/re2/util/utf.h +44 -0
- package/index.js +14 -5
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/@nxtedition+rocksdb.node +0 -0
- package/prebuilds/linux-x64/@nxtedition+rocksdb.node +0 -0
- package/util.h +10 -16
|
@@ -0,0 +1,4184 @@
|
|
|
1
|
+
// Copyright 2018 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/container/internal/raw_hash_set.h"
|
|
16
|
+
|
|
17
|
+
#include <algorithm>
|
|
18
|
+
#include <array>
|
|
19
|
+
#include <atomic>
|
|
20
|
+
#include <bitset>
|
|
21
|
+
#include <cmath>
|
|
22
|
+
#include <cstddef>
|
|
23
|
+
#include <cstdint>
|
|
24
|
+
#include <cstring>
|
|
25
|
+
#include <deque>
|
|
26
|
+
#include <functional>
|
|
27
|
+
#include <iostream>
|
|
28
|
+
#include <iterator>
|
|
29
|
+
#include <limits>
|
|
30
|
+
#include <list>
|
|
31
|
+
#include <map>
|
|
32
|
+
#include <memory>
|
|
33
|
+
#include <numeric>
|
|
34
|
+
#include <ostream>
|
|
35
|
+
#include <random>
|
|
36
|
+
#include <set>
|
|
37
|
+
#include <string>
|
|
38
|
+
#include <tuple>
|
|
39
|
+
#include <type_traits>
|
|
40
|
+
#include <unordered_map>
|
|
41
|
+
#include <unordered_set>
|
|
42
|
+
#include <utility>
|
|
43
|
+
#include <vector>
|
|
44
|
+
|
|
45
|
+
#include "gmock/gmock.h"
|
|
46
|
+
#include "gtest/gtest.h"
|
|
47
|
+
#include "absl/base/attributes.h"
|
|
48
|
+
#include "absl/base/config.h"
|
|
49
|
+
#include "absl/base/internal/cycleclock.h"
|
|
50
|
+
#include "absl/base/prefetch.h"
|
|
51
|
+
#include "absl/container/flat_hash_map.h"
|
|
52
|
+
#include "absl/container/flat_hash_set.h"
|
|
53
|
+
#include "absl/container/internal/container_memory.h"
|
|
54
|
+
#include "absl/container/internal/hash_function_defaults.h"
|
|
55
|
+
#include "absl/container/internal/hash_policy_testing.h"
|
|
56
|
+
#include "absl/random/random.h"
|
|
57
|
+
#include "absl/container/internal/hashtable_control_bytes.h"
|
|
58
|
+
#include "absl/container/internal/hashtable_debug.h"
|
|
59
|
+
#include "absl/container/internal/hashtablez_sampler.h"
|
|
60
|
+
#include "absl/container/internal/raw_hash_set_resize_impl.h"
|
|
61
|
+
#include "absl/container/internal/test_allocator.h"
|
|
62
|
+
#include "absl/container/internal/test_instance_tracker.h"
|
|
63
|
+
#include "absl/container/node_hash_set.h"
|
|
64
|
+
#include "absl/functional/function_ref.h"
|
|
65
|
+
#include "absl/hash/hash.h"
|
|
66
|
+
#include "absl/log/check.h"
|
|
67
|
+
#include "absl/log/log.h"
|
|
68
|
+
#include "absl/memory/memory.h"
|
|
69
|
+
#include "absl/meta/type_traits.h"
|
|
70
|
+
#include "absl/numeric/int128.h"
|
|
71
|
+
#include "absl/strings/str_cat.h"
|
|
72
|
+
#include "absl/strings/string_view.h"
|
|
73
|
+
#include "absl/types/optional.h"
|
|
74
|
+
|
|
75
|
+
namespace absl {
|
|
76
|
+
ABSL_NAMESPACE_BEGIN
|
|
77
|
+
namespace container_internal {
|
|
78
|
+
|
|
79
|
+
struct RawHashSetTestOnlyAccess {
|
|
80
|
+
template <typename C>
|
|
81
|
+
static auto GetCommon(C&& c) -> decltype(std::forward<C>(c).common()) {
|
|
82
|
+
return std::forward<C>(c).common();
|
|
83
|
+
}
|
|
84
|
+
template <typename C>
|
|
85
|
+
static auto GetSlots(const C& c) -> decltype(c.slot_array()) {
|
|
86
|
+
return c.slot_array();
|
|
87
|
+
}
|
|
88
|
+
template <typename C>
|
|
89
|
+
static size_t CountTombstones(const C& c) {
|
|
90
|
+
return c.common().TombstonesCount();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
namespace {
|
|
95
|
+
|
|
96
|
+
using ::testing::ElementsAre;
|
|
97
|
+
using ::testing::Eq;
|
|
98
|
+
using ::testing::Ge;
|
|
99
|
+
using ::testing::Lt;
|
|
100
|
+
using ::testing::Pair;
|
|
101
|
+
using ::testing::UnorderedElementsAre;
|
|
102
|
+
using ::testing::UnorderedElementsAreArray;
|
|
103
|
+
|
|
104
|
+
// Convenience function to static cast to ctrl_t.
|
|
105
|
+
ctrl_t CtrlT(int i) { return static_cast<ctrl_t>(i); }
|
|
106
|
+
|
|
107
|
+
// Enables sampling with 1 percent sampling rate and
|
|
108
|
+
// resets the rate counter for the current thread.
|
|
109
|
+
void SetSamplingRateTo1Percent() {
|
|
110
|
+
SetHashtablezEnabled(true);
|
|
111
|
+
SetHashtablezSampleParameter(100); // Sample ~1% of tables.
|
|
112
|
+
// Reset rate counter for the current thread.
|
|
113
|
+
TestOnlyRefreshSamplingStateForCurrentThread();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Disables sampling and resets the rate counter for the current thread.
|
|
117
|
+
void DisableSampling() {
|
|
118
|
+
SetHashtablezEnabled(false);
|
|
119
|
+
SetHashtablezSampleParameter(1 << 16);
|
|
120
|
+
// Reset rate counter for the current thread.
|
|
121
|
+
TestOnlyRefreshSamplingStateForCurrentThread();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
TEST(GrowthInfoTest, GetGrowthLeft) {
|
|
125
|
+
GrowthInfo gi;
|
|
126
|
+
gi.InitGrowthLeftNoDeleted(5);
|
|
127
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 5);
|
|
128
|
+
gi.OverwriteFullAsDeleted();
|
|
129
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 5);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
TEST(GrowthInfoTest, HasNoDeleted) {
|
|
133
|
+
GrowthInfo gi;
|
|
134
|
+
gi.InitGrowthLeftNoDeleted(5);
|
|
135
|
+
EXPECT_TRUE(gi.HasNoDeleted());
|
|
136
|
+
gi.OverwriteFullAsDeleted();
|
|
137
|
+
EXPECT_FALSE(gi.HasNoDeleted());
|
|
138
|
+
// After reinitialization we have no deleted slots.
|
|
139
|
+
gi.InitGrowthLeftNoDeleted(5);
|
|
140
|
+
EXPECT_TRUE(gi.HasNoDeleted());
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
TEST(GrowthInfoTest, HasNoDeletedAndGrowthLeft) {
|
|
144
|
+
GrowthInfo gi;
|
|
145
|
+
gi.InitGrowthLeftNoDeleted(5);
|
|
146
|
+
EXPECT_TRUE(gi.HasNoDeletedAndGrowthLeft());
|
|
147
|
+
gi.OverwriteFullAsDeleted();
|
|
148
|
+
EXPECT_FALSE(gi.HasNoDeletedAndGrowthLeft());
|
|
149
|
+
gi.InitGrowthLeftNoDeleted(0);
|
|
150
|
+
EXPECT_FALSE(gi.HasNoDeletedAndGrowthLeft());
|
|
151
|
+
gi.OverwriteFullAsDeleted();
|
|
152
|
+
EXPECT_FALSE(gi.HasNoDeletedAndGrowthLeft());
|
|
153
|
+
// After reinitialization we have no deleted slots.
|
|
154
|
+
gi.InitGrowthLeftNoDeleted(5);
|
|
155
|
+
EXPECT_TRUE(gi.HasNoDeletedAndGrowthLeft());
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
TEST(GrowthInfoTest, HasNoGrowthLeftAndNoDeleted) {
|
|
159
|
+
GrowthInfo gi;
|
|
160
|
+
gi.InitGrowthLeftNoDeleted(1);
|
|
161
|
+
EXPECT_FALSE(gi.HasNoGrowthLeftAndNoDeleted());
|
|
162
|
+
gi.OverwriteEmptyAsFull();
|
|
163
|
+
EXPECT_TRUE(gi.HasNoGrowthLeftAndNoDeleted());
|
|
164
|
+
gi.OverwriteFullAsDeleted();
|
|
165
|
+
EXPECT_FALSE(gi.HasNoGrowthLeftAndNoDeleted());
|
|
166
|
+
gi.OverwriteFullAsEmpty();
|
|
167
|
+
EXPECT_FALSE(gi.HasNoGrowthLeftAndNoDeleted());
|
|
168
|
+
gi.InitGrowthLeftNoDeleted(0);
|
|
169
|
+
EXPECT_TRUE(gi.HasNoGrowthLeftAndNoDeleted());
|
|
170
|
+
gi.OverwriteFullAsEmpty();
|
|
171
|
+
EXPECT_FALSE(gi.HasNoGrowthLeftAndNoDeleted());
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
TEST(GrowthInfoTest, OverwriteFullAsEmpty) {
|
|
175
|
+
GrowthInfo gi;
|
|
176
|
+
gi.InitGrowthLeftNoDeleted(5);
|
|
177
|
+
gi.OverwriteFullAsEmpty();
|
|
178
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 6);
|
|
179
|
+
gi.OverwriteFullAsDeleted();
|
|
180
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 6);
|
|
181
|
+
gi.OverwriteFullAsEmpty();
|
|
182
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 7);
|
|
183
|
+
EXPECT_FALSE(gi.HasNoDeleted());
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
TEST(GrowthInfoTest, OverwriteEmptyAsFull) {
|
|
187
|
+
GrowthInfo gi;
|
|
188
|
+
gi.InitGrowthLeftNoDeleted(5);
|
|
189
|
+
gi.OverwriteEmptyAsFull();
|
|
190
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 4);
|
|
191
|
+
gi.OverwriteFullAsDeleted();
|
|
192
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 4);
|
|
193
|
+
gi.OverwriteEmptyAsFull();
|
|
194
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 3);
|
|
195
|
+
EXPECT_FALSE(gi.HasNoDeleted());
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
TEST(GrowthInfoTest, OverwriteControlAsFull) {
|
|
199
|
+
GrowthInfo gi;
|
|
200
|
+
gi.InitGrowthLeftNoDeleted(5);
|
|
201
|
+
gi.OverwriteControlAsFull(ctrl_t::kEmpty);
|
|
202
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 4);
|
|
203
|
+
gi.OverwriteControlAsFull(ctrl_t::kDeleted);
|
|
204
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 4);
|
|
205
|
+
gi.OverwriteFullAsDeleted();
|
|
206
|
+
gi.OverwriteControlAsFull(ctrl_t::kDeleted);
|
|
207
|
+
// We do not count number of deleted, so the bit sticks till the next rehash.
|
|
208
|
+
EXPECT_FALSE(gi.HasNoDeletedAndGrowthLeft());
|
|
209
|
+
EXPECT_FALSE(gi.HasNoDeleted());
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
TEST(GrowthInfoTest, HasNoGrowthLeftAssumingMayHaveDeleted) {
|
|
213
|
+
GrowthInfo gi;
|
|
214
|
+
gi.InitGrowthLeftNoDeleted(1);
|
|
215
|
+
gi.OverwriteFullAsDeleted();
|
|
216
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 1);
|
|
217
|
+
EXPECT_FALSE(gi.HasNoGrowthLeftAssumingMayHaveDeleted());
|
|
218
|
+
gi.OverwriteControlAsFull(ctrl_t::kDeleted);
|
|
219
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 1);
|
|
220
|
+
EXPECT_FALSE(gi.HasNoGrowthLeftAssumingMayHaveDeleted());
|
|
221
|
+
gi.OverwriteFullAsEmpty();
|
|
222
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 2);
|
|
223
|
+
EXPECT_FALSE(gi.HasNoGrowthLeftAssumingMayHaveDeleted());
|
|
224
|
+
gi.OverwriteEmptyAsFull();
|
|
225
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 1);
|
|
226
|
+
EXPECT_FALSE(gi.HasNoGrowthLeftAssumingMayHaveDeleted());
|
|
227
|
+
gi.OverwriteEmptyAsFull();
|
|
228
|
+
EXPECT_EQ(gi.GetGrowthLeft(), 0);
|
|
229
|
+
EXPECT_TRUE(gi.HasNoGrowthLeftAssumingMayHaveDeleted());
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
TEST(Util, OptimalMemcpySizeForSooSlotTransfer) {
|
|
233
|
+
EXPECT_EQ(1, OptimalMemcpySizeForSooSlotTransfer(1));
|
|
234
|
+
ASSERT_EQ(4, OptimalMemcpySizeForSooSlotTransfer(2));
|
|
235
|
+
ASSERT_EQ(4, OptimalMemcpySizeForSooSlotTransfer(3));
|
|
236
|
+
for (size_t slot_size = 4; slot_size <= 8; ++slot_size) {
|
|
237
|
+
ASSERT_EQ(8, OptimalMemcpySizeForSooSlotTransfer(slot_size));
|
|
238
|
+
}
|
|
239
|
+
// If maximum amount of memory is 16, then we can copy up to 16 bytes.
|
|
240
|
+
for (size_t slot_size = 9; slot_size <= 16; ++slot_size) {
|
|
241
|
+
ASSERT_EQ(16,
|
|
242
|
+
OptimalMemcpySizeForSooSlotTransfer(slot_size,
|
|
243
|
+
/*max_soo_slot_size=*/16));
|
|
244
|
+
ASSERT_EQ(16,
|
|
245
|
+
OptimalMemcpySizeForSooSlotTransfer(slot_size,
|
|
246
|
+
/*max_soo_slot_size=*/24));
|
|
247
|
+
}
|
|
248
|
+
// But we shouldn't try to copy more than maximum amount of memory.
|
|
249
|
+
for (size_t slot_size = 9; slot_size <= 12; ++slot_size) {
|
|
250
|
+
ASSERT_EQ(12, OptimalMemcpySizeForSooSlotTransfer(
|
|
251
|
+
slot_size, /*max_soo_slot_size=*/12));
|
|
252
|
+
}
|
|
253
|
+
for (size_t slot_size = 17; slot_size <= 24; ++slot_size) {
|
|
254
|
+
ASSERT_EQ(24,
|
|
255
|
+
OptimalMemcpySizeForSooSlotTransfer(slot_size,
|
|
256
|
+
/*max_soo_slot_size=*/24));
|
|
257
|
+
}
|
|
258
|
+
// We shouldn't copy more than maximum.
|
|
259
|
+
for (size_t slot_size = 17; slot_size <= 20; ++slot_size) {
|
|
260
|
+
ASSERT_EQ(20,
|
|
261
|
+
OptimalMemcpySizeForSooSlotTransfer(slot_size,
|
|
262
|
+
/*max_soo_slot_size=*/20));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
TEST(Util, NormalizeCapacity) {
|
|
267
|
+
EXPECT_EQ(1, NormalizeCapacity(0));
|
|
268
|
+
EXPECT_EQ(1, NormalizeCapacity(1));
|
|
269
|
+
EXPECT_EQ(3, NormalizeCapacity(2));
|
|
270
|
+
EXPECT_EQ(3, NormalizeCapacity(3));
|
|
271
|
+
EXPECT_EQ(7, NormalizeCapacity(4));
|
|
272
|
+
EXPECT_EQ(7, NormalizeCapacity(7));
|
|
273
|
+
EXPECT_EQ(15, NormalizeCapacity(8));
|
|
274
|
+
EXPECT_EQ(15, NormalizeCapacity(15));
|
|
275
|
+
EXPECT_EQ(15 * 2 + 1, NormalizeCapacity(15 + 1));
|
|
276
|
+
EXPECT_EQ(15 * 2 + 1, NormalizeCapacity(15 + 2));
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
TEST(Util, SizeToCapacitySmallValues) {
|
|
280
|
+
EXPECT_EQ(SizeToCapacity(0), 0);
|
|
281
|
+
EXPECT_EQ(SizeToCapacity(1), 1);
|
|
282
|
+
EXPECT_EQ(SizeToCapacity(2), 3);
|
|
283
|
+
EXPECT_EQ(SizeToCapacity(3), 3);
|
|
284
|
+
EXPECT_EQ(SizeToCapacity(4), 7);
|
|
285
|
+
EXPECT_EQ(SizeToCapacity(5), 7);
|
|
286
|
+
EXPECT_EQ(SizeToCapacity(6), 7);
|
|
287
|
+
if (Group::kWidth == 16) {
|
|
288
|
+
EXPECT_EQ(SizeToCapacity(7), 7);
|
|
289
|
+
EXPECT_EQ(SizeToCapacity(14), 15);
|
|
290
|
+
} else {
|
|
291
|
+
EXPECT_EQ(SizeToCapacity(7), 15);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
TEST(Util, CapacityToGrowthSmallValues) {
|
|
296
|
+
EXPECT_EQ(CapacityToGrowth(1), 1);
|
|
297
|
+
EXPECT_EQ(CapacityToGrowth(3), 3);
|
|
298
|
+
if (Group::kWidth == 16) {
|
|
299
|
+
EXPECT_EQ(CapacityToGrowth(7), 7);
|
|
300
|
+
} else {
|
|
301
|
+
EXPECT_EQ(CapacityToGrowth(7), 6);
|
|
302
|
+
}
|
|
303
|
+
EXPECT_EQ(CapacityToGrowth(15), 14);
|
|
304
|
+
EXPECT_EQ(CapacityToGrowth(31), 28);
|
|
305
|
+
EXPECT_EQ(CapacityToGrowth(63), 56);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
TEST(Util, GrowthAndCapacity) {
|
|
309
|
+
// Verify that GrowthToCapacity gives the minimum capacity that has enough
|
|
310
|
+
// growth.
|
|
311
|
+
for (size_t growth = 1; growth < 10000; ++growth) {
|
|
312
|
+
SCOPED_TRACE(growth);
|
|
313
|
+
size_t capacity = SizeToCapacity(growth);
|
|
314
|
+
ASSERT_TRUE(IsValidCapacity(capacity));
|
|
315
|
+
// The capacity is large enough for `growth`.
|
|
316
|
+
ASSERT_THAT(CapacityToGrowth(capacity), Ge(growth));
|
|
317
|
+
// For (capacity+1) < kWidth, growth should equal capacity.
|
|
318
|
+
if (capacity + 1 < Group::kWidth) {
|
|
319
|
+
ASSERT_THAT(CapacityToGrowth(capacity), Eq(capacity));
|
|
320
|
+
} else {
|
|
321
|
+
ASSERT_THAT(CapacityToGrowth(capacity), Lt(capacity));
|
|
322
|
+
}
|
|
323
|
+
if (growth != 0 && capacity > 1) {
|
|
324
|
+
// There is no smaller capacity that works.
|
|
325
|
+
ASSERT_THAT(CapacityToGrowth(capacity / 2), Lt(growth)) << capacity;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
for (size_t capacity = Group::kWidth - 1; capacity < 10000;
|
|
330
|
+
capacity = 2 * capacity + 1) {
|
|
331
|
+
SCOPED_TRACE(capacity);
|
|
332
|
+
size_t growth = CapacityToGrowth(capacity);
|
|
333
|
+
ASSERT_THAT(growth, Lt(capacity));
|
|
334
|
+
ASSERT_EQ(SizeToCapacity(growth), capacity);
|
|
335
|
+
ASSERT_EQ(NormalizeCapacity(SizeToCapacity(growth)), capacity);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
TEST(Util, probe_seq) {
|
|
340
|
+
probe_seq<16> seq(0, 127);
|
|
341
|
+
auto gen = [&]() {
|
|
342
|
+
size_t res = seq.offset();
|
|
343
|
+
seq.next();
|
|
344
|
+
return res;
|
|
345
|
+
};
|
|
346
|
+
std::vector<size_t> offsets(8);
|
|
347
|
+
std::generate_n(offsets.begin(), 8, gen);
|
|
348
|
+
EXPECT_THAT(offsets, ElementsAre(0, 16, 48, 96, 32, 112, 80, 64));
|
|
349
|
+
seq = probe_seq<16>(128, 127);
|
|
350
|
+
std::generate_n(offsets.begin(), 8, gen);
|
|
351
|
+
EXPECT_THAT(offsets, ElementsAre(0, 16, 48, 96, 32, 112, 80, 64));
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
TEST(Batch, DropDeletes) {
|
|
355
|
+
constexpr size_t kCapacity = 63;
|
|
356
|
+
constexpr size_t kGroupWidth = container_internal::Group::kWidth;
|
|
357
|
+
std::vector<ctrl_t> ctrl(kCapacity + 1 + kGroupWidth);
|
|
358
|
+
ctrl[kCapacity] = ctrl_t::kSentinel;
|
|
359
|
+
std::vector<ctrl_t> pattern = {
|
|
360
|
+
ctrl_t::kEmpty, CtrlT(2), ctrl_t::kDeleted, CtrlT(2),
|
|
361
|
+
ctrl_t::kEmpty, CtrlT(1), ctrl_t::kDeleted};
|
|
362
|
+
for (size_t i = 0; i != kCapacity; ++i) {
|
|
363
|
+
ctrl[i] = pattern[i % pattern.size()];
|
|
364
|
+
if (i < kGroupWidth - 1)
|
|
365
|
+
ctrl[i + kCapacity + 1] = pattern[i % pattern.size()];
|
|
366
|
+
}
|
|
367
|
+
ConvertDeletedToEmptyAndFullToDeleted(ctrl.data(), kCapacity);
|
|
368
|
+
ASSERT_EQ(ctrl[kCapacity], ctrl_t::kSentinel);
|
|
369
|
+
for (size_t i = 0; i < kCapacity + kGroupWidth; ++i) {
|
|
370
|
+
ctrl_t expected = pattern[i % (kCapacity + 1) % pattern.size()];
|
|
371
|
+
if (i == kCapacity) expected = ctrl_t::kSentinel;
|
|
372
|
+
if (expected == ctrl_t::kDeleted) expected = ctrl_t::kEmpty;
|
|
373
|
+
if (IsFull(expected)) expected = ctrl_t::kDeleted;
|
|
374
|
+
EXPECT_EQ(ctrl[i], expected)
|
|
375
|
+
<< i << " " << static_cast<int>(pattern[i % pattern.size()]);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
template <class T, bool kTransferable = false, bool kSoo = false>
|
|
380
|
+
struct ValuePolicy {
|
|
381
|
+
using slot_type = T;
|
|
382
|
+
using key_type = T;
|
|
383
|
+
using init_type = T;
|
|
384
|
+
|
|
385
|
+
using DefaultHash = hash_default_hash<T>;
|
|
386
|
+
using DefaultEq = std::equal_to<T>;
|
|
387
|
+
using DefaultAlloc = std::allocator<T>;
|
|
388
|
+
|
|
389
|
+
template <class Allocator, class... Args>
|
|
390
|
+
static void construct(Allocator* alloc, slot_type* slot, Args&&... args) {
|
|
391
|
+
absl::allocator_traits<Allocator>::construct(*alloc, slot,
|
|
392
|
+
std::forward<Args>(args)...);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
template <class Allocator>
|
|
396
|
+
static void destroy(Allocator* alloc, slot_type* slot) {
|
|
397
|
+
absl::allocator_traits<Allocator>::destroy(*alloc, slot);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
template <class Allocator>
|
|
401
|
+
static std::integral_constant<bool, kTransferable> transfer(
|
|
402
|
+
Allocator* alloc, slot_type* new_slot, slot_type* old_slot) {
|
|
403
|
+
construct(alloc, new_slot, std::move(*old_slot));
|
|
404
|
+
destroy(alloc, old_slot);
|
|
405
|
+
return {};
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
static T& element(slot_type* slot) { return *slot; }
|
|
409
|
+
|
|
410
|
+
template <class F, class... Args>
|
|
411
|
+
static decltype(absl::container_internal::DecomposeValue(
|
|
412
|
+
std::declval<F>(), std::declval<Args>()...))
|
|
413
|
+
apply(F&& f, Args&&... args) {
|
|
414
|
+
return absl::container_internal::DecomposeValue(
|
|
415
|
+
std::forward<F>(f), std::forward<Args>(args)...);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
template <class Hash, bool kIsDefault>
|
|
419
|
+
static constexpr HashSlotFn get_hash_slot_fn() {
|
|
420
|
+
return nullptr;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
static constexpr bool soo_enabled() { return kSoo; }
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
using IntPolicy = ValuePolicy<int64_t>;
|
|
427
|
+
using Uint8Policy = ValuePolicy<uint8_t>;
|
|
428
|
+
|
|
429
|
+
// For testing SOO.
|
|
430
|
+
template <int N>
|
|
431
|
+
class SizedValue {
|
|
432
|
+
public:
|
|
433
|
+
SizedValue(int64_t v) { // NOLINT
|
|
434
|
+
vals_[0] = v;
|
|
435
|
+
}
|
|
436
|
+
SizedValue() : SizedValue(0) {}
|
|
437
|
+
SizedValue(const SizedValue&) = default;
|
|
438
|
+
SizedValue& operator=(const SizedValue&) = default;
|
|
439
|
+
|
|
440
|
+
int64_t operator*() const {
|
|
441
|
+
// Suppress erroneous uninitialized memory errors on GCC.
|
|
442
|
+
#if !defined(__clang__) && defined(__GNUC__)
|
|
443
|
+
#pragma GCC diagnostic push
|
|
444
|
+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
|
445
|
+
#endif
|
|
446
|
+
return vals_[0];
|
|
447
|
+
#if !defined(__clang__) && defined(__GNUC__)
|
|
448
|
+
#pragma GCC diagnostic pop
|
|
449
|
+
#endif
|
|
450
|
+
}
|
|
451
|
+
explicit operator int() const { return **this; }
|
|
452
|
+
explicit operator int64_t() const { return **this; }
|
|
453
|
+
|
|
454
|
+
template <typename H>
|
|
455
|
+
friend H AbslHashValue(H h, SizedValue sv) {
|
|
456
|
+
return H::combine(std::move(h), *sv);
|
|
457
|
+
}
|
|
458
|
+
bool operator==(const SizedValue& rhs) const { return **this == *rhs; }
|
|
459
|
+
|
|
460
|
+
private:
|
|
461
|
+
int64_t vals_[N / sizeof(int64_t)];
|
|
462
|
+
};
|
|
463
|
+
template <int N, bool kSoo>
|
|
464
|
+
using SizedValuePolicy =
|
|
465
|
+
ValuePolicy<SizedValue<N>, /*kTransferable=*/true, kSoo>;
|
|
466
|
+
|
|
467
|
+
// Value is aligned as type T and contains N copies of it.
|
|
468
|
+
template <typename T, int N>
|
|
469
|
+
class AlignedValue {
|
|
470
|
+
public:
|
|
471
|
+
AlignedValue(int64_t v) { // NOLINT
|
|
472
|
+
for (int i = 0; i < N; ++i) {
|
|
473
|
+
vals_[i] = v;
|
|
474
|
+
if (sizeof(T) < sizeof(int64_t)) {
|
|
475
|
+
v >>= (8 * sizeof(T));
|
|
476
|
+
} else {
|
|
477
|
+
v = 0;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
AlignedValue() : AlignedValue(0) {}
|
|
482
|
+
AlignedValue(const AlignedValue&) = default;
|
|
483
|
+
AlignedValue& operator=(const AlignedValue&) = default;
|
|
484
|
+
|
|
485
|
+
int64_t operator*() const {
|
|
486
|
+
if (sizeof(T) == sizeof(int64_t)) {
|
|
487
|
+
return vals_[0];
|
|
488
|
+
}
|
|
489
|
+
int64_t result = 0;
|
|
490
|
+
for (int i = N - 1; i >= 0; --i) {
|
|
491
|
+
result <<= (8 * sizeof(T));
|
|
492
|
+
result += vals_[i];
|
|
493
|
+
}
|
|
494
|
+
return result;
|
|
495
|
+
}
|
|
496
|
+
explicit operator int() const { return **this; }
|
|
497
|
+
explicit operator int64_t() const { return **this; }
|
|
498
|
+
|
|
499
|
+
template <typename H>
|
|
500
|
+
friend H AbslHashValue(H h, AlignedValue sv) {
|
|
501
|
+
return H::combine(std::move(h), *sv);
|
|
502
|
+
}
|
|
503
|
+
bool operator==(const AlignedValue& rhs) const { return **this == *rhs; }
|
|
504
|
+
|
|
505
|
+
private:
|
|
506
|
+
T vals_[N];
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
class StringPolicy {
|
|
510
|
+
template <class F, class K, class V,
|
|
511
|
+
class = typename std::enable_if<
|
|
512
|
+
std::is_convertible<const K&, absl::string_view>::value>::type>
|
|
513
|
+
decltype(std::declval<F>()(
|
|
514
|
+
std::declval<const absl::string_view&>(), std::piecewise_construct,
|
|
515
|
+
std::declval<std::tuple<K>>(),
|
|
516
|
+
std::declval<V>())) static apply_impl(F&& f,
|
|
517
|
+
std::pair<std::tuple<K>, V> p) {
|
|
518
|
+
const absl::string_view& key = std::get<0>(p.first);
|
|
519
|
+
return std::forward<F>(f)(key, std::piecewise_construct, std::move(p.first),
|
|
520
|
+
std::move(p.second));
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
public:
|
|
524
|
+
struct slot_type {
|
|
525
|
+
struct ctor {};
|
|
526
|
+
|
|
527
|
+
template <class... Ts>
|
|
528
|
+
explicit slot_type(ctor, Ts&&... ts) : pair(std::forward<Ts>(ts)...) {}
|
|
529
|
+
|
|
530
|
+
std::pair<std::string, std::string> pair;
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
using key_type = std::string;
|
|
534
|
+
using init_type = std::pair<std::string, std::string>;
|
|
535
|
+
|
|
536
|
+
using DefaultHash = void;
|
|
537
|
+
using DefaultEq = void;
|
|
538
|
+
using DefaultAlloc = void;
|
|
539
|
+
|
|
540
|
+
template <class allocator_type, class... Args>
|
|
541
|
+
static void construct(allocator_type* alloc, slot_type* slot, Args... args) {
|
|
542
|
+
std::allocator_traits<allocator_type>::construct(
|
|
543
|
+
*alloc, slot, typename slot_type::ctor(), std::forward<Args>(args)...);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
template <class allocator_type>
|
|
547
|
+
static void destroy(allocator_type* alloc, slot_type* slot) {
|
|
548
|
+
std::allocator_traits<allocator_type>::destroy(*alloc, slot);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
template <class allocator_type>
|
|
552
|
+
static void transfer(allocator_type* alloc, slot_type* new_slot,
|
|
553
|
+
slot_type* old_slot) {
|
|
554
|
+
construct(alloc, new_slot, std::move(old_slot->pair));
|
|
555
|
+
destroy(alloc, old_slot);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
static std::pair<std::string, std::string>& element(slot_type* slot) {
|
|
559
|
+
return slot->pair;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
template <class F, class... Args>
|
|
563
|
+
static auto apply(F&& f, Args&&... args)
|
|
564
|
+
-> decltype(apply_impl(std::forward<F>(f),
|
|
565
|
+
PairArgs(std::forward<Args>(args)...))) {
|
|
566
|
+
return apply_impl(std::forward<F>(f),
|
|
567
|
+
PairArgs(std::forward<Args>(args)...));
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
template <class Hash, bool kIsDefault>
|
|
571
|
+
static constexpr HashSlotFn get_hash_slot_fn() {
|
|
572
|
+
return nullptr;
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
struct StringHash : absl::Hash<absl::string_view> {
|
|
577
|
+
using is_transparent = void;
|
|
578
|
+
};
|
|
579
|
+
struct StringEq : std::equal_to<absl::string_view> {
|
|
580
|
+
using is_transparent = void;
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
struct StringTable
|
|
584
|
+
: raw_hash_set<StringPolicy, StringHash, StringEq, std::allocator<int>> {
|
|
585
|
+
using Base = typename StringTable::raw_hash_set;
|
|
586
|
+
StringTable() = default;
|
|
587
|
+
using Base::Base;
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
template <typename T, bool kTransferable = false, bool kSoo = false,
|
|
591
|
+
class Alloc = std::allocator<T>>
|
|
592
|
+
struct ValueTable : InstantiateRawHashSet<ValuePolicy<T, kTransferable, kSoo>,
|
|
593
|
+
hash_default_hash<T>,
|
|
594
|
+
std::equal_to<T>, Alloc>::type {
|
|
595
|
+
using Base = typename ValueTable::raw_hash_set;
|
|
596
|
+
using Base::Base;
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
using IntTable = ValueTable<int64_t>;
|
|
600
|
+
using Uint8Table = ValueTable<uint8_t>;
|
|
601
|
+
|
|
602
|
+
using TransferableIntTable = ValueTable<int64_t, /*kTransferable=*/true>;
|
|
603
|
+
|
|
604
|
+
template <typename T>
|
|
605
|
+
struct CustomAlloc : std::allocator<T> {
|
|
606
|
+
CustomAlloc() = default;
|
|
607
|
+
|
|
608
|
+
template <typename U>
|
|
609
|
+
explicit CustomAlloc(const CustomAlloc<U>& /*other*/) {}
|
|
610
|
+
|
|
611
|
+
template <class U>
|
|
612
|
+
struct rebind {
|
|
613
|
+
using other = CustomAlloc<U>;
|
|
614
|
+
};
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
struct CustomAllocIntTable
|
|
618
|
+
: raw_hash_set<IntPolicy, hash_default_hash<int64_t>,
|
|
619
|
+
std::equal_to<int64_t>, CustomAlloc<int64_t>> {
|
|
620
|
+
using Base = typename CustomAllocIntTable::raw_hash_set;
|
|
621
|
+
using Base::Base;
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
template <typename T>
|
|
625
|
+
struct ChangingSizeAndTrackingTypeAlloc : std::allocator<T> {
|
|
626
|
+
ChangingSizeAndTrackingTypeAlloc() = default;
|
|
627
|
+
|
|
628
|
+
template <typename U>
|
|
629
|
+
explicit ChangingSizeAndTrackingTypeAlloc(
|
|
630
|
+
const ChangingSizeAndTrackingTypeAlloc<U>& other) {
|
|
631
|
+
EXPECT_EQ(other.type_id,
|
|
632
|
+
ChangingSizeAndTrackingTypeAlloc<U>::ComputeTypeId());
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
template <class U>
|
|
636
|
+
struct rebind {
|
|
637
|
+
using other = ChangingSizeAndTrackingTypeAlloc<U>;
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
T* allocate(size_t n) {
|
|
641
|
+
EXPECT_EQ(type_id, ComputeTypeId());
|
|
642
|
+
return std::allocator<T>::allocate(n);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
void deallocate(T* p, std::size_t n) {
|
|
646
|
+
EXPECT_EQ(type_id, ComputeTypeId());
|
|
647
|
+
return std::allocator<T>::deallocate(p, n);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
static size_t ComputeTypeId() { return absl::HashOf(typeid(T).name()); }
|
|
651
|
+
|
|
652
|
+
// We add extra data to make the allocator size being changed.
|
|
653
|
+
// This also make type_id positioned differently, so that assertions in the
|
|
654
|
+
// allocator can catch bugs more likely.
|
|
655
|
+
char data_before[sizeof(T) * 3] = {0};
|
|
656
|
+
size_t type_id = ComputeTypeId();
|
|
657
|
+
char data_after[sizeof(T) * 5] = {0};
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
struct ChangingSizeAllocIntTable
|
|
661
|
+
: raw_hash_set<IntPolicy, hash_default_hash<int64_t>,
|
|
662
|
+
std::equal_to<int64_t>,
|
|
663
|
+
ChangingSizeAndTrackingTypeAlloc<int64_t>> {
|
|
664
|
+
using Base = typename ChangingSizeAllocIntTable::raw_hash_set;
|
|
665
|
+
using Base::Base;
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
struct MinimumAlignmentUint8Table
|
|
669
|
+
: raw_hash_set<Uint8Policy, hash_default_hash<uint8_t>,
|
|
670
|
+
std::equal_to<uint8_t>, MinimumAlignmentAlloc<uint8_t>> {
|
|
671
|
+
using Base = typename MinimumAlignmentUint8Table::raw_hash_set;
|
|
672
|
+
using Base::Base;
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
// Allows for freezing the allocator to expect no further allocations.
|
|
676
|
+
template <typename T>
|
|
677
|
+
struct FreezableAlloc : std::allocator<T> {
|
|
678
|
+
explicit FreezableAlloc(bool* f) : frozen(f) {}
|
|
679
|
+
|
|
680
|
+
template <typename U>
|
|
681
|
+
explicit FreezableAlloc(const FreezableAlloc<U>& other)
|
|
682
|
+
: frozen(other.frozen) {}
|
|
683
|
+
|
|
684
|
+
template <class U>
|
|
685
|
+
struct rebind {
|
|
686
|
+
using other = FreezableAlloc<U>;
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
T* allocate(size_t n) {
|
|
690
|
+
EXPECT_FALSE(*frozen);
|
|
691
|
+
return std::allocator<T>::allocate(n);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
bool* frozen;
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
template <int N>
|
|
698
|
+
struct FreezableSizedValueSooTable
|
|
699
|
+
: raw_hash_set<SizedValuePolicy<N, /*kSoo=*/true>,
|
|
700
|
+
container_internal::hash_default_hash<SizedValue<N>>,
|
|
701
|
+
std::equal_to<SizedValue<N>>,
|
|
702
|
+
FreezableAlloc<SizedValue<N>>> {
|
|
703
|
+
using Base = typename FreezableSizedValueSooTable::raw_hash_set;
|
|
704
|
+
using Base::Base;
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
struct BadFastHash {
|
|
708
|
+
template <class T>
|
|
709
|
+
size_t operator()(const T&) const {
|
|
710
|
+
return 0;
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
|
|
714
|
+
struct BadHashFreezableIntTable
|
|
715
|
+
: raw_hash_set<IntPolicy, BadFastHash, std::equal_to<int64_t>,
|
|
716
|
+
FreezableAlloc<int64_t>> {
|
|
717
|
+
using Base = typename BadHashFreezableIntTable::raw_hash_set;
|
|
718
|
+
using Base::Base;
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
struct BadTable : raw_hash_set<IntPolicy, BadFastHash, std::equal_to<int64_t>,
|
|
722
|
+
std::allocator<int>> {
|
|
723
|
+
using Base = typename BadTable::raw_hash_set;
|
|
724
|
+
BadTable() = default;
|
|
725
|
+
using Base::Base;
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
constexpr size_t kNonSooSize = sizeof(HeapOrSoo) + 8;
|
|
729
|
+
using NonSooIntTableSlotType = SizedValue<kNonSooSize>;
|
|
730
|
+
static_assert(sizeof(NonSooIntTableSlotType) >= kNonSooSize, "too small");
|
|
731
|
+
using NonSooIntTable = ValueTable<NonSooIntTableSlotType>;
|
|
732
|
+
using SooInt32Table =
|
|
733
|
+
ValueTable<int32_t, /*kTransferable=*/true, /*kSoo=*/true>;
|
|
734
|
+
using SooIntTable = ValueTable<int64_t, /*kTransferable=*/true, /*kSoo=*/true>;
|
|
735
|
+
using NonMemcpyableSooIntTable =
|
|
736
|
+
ValueTable<int64_t, /*kTransferable=*/false, /*kSoo=*/true>;
|
|
737
|
+
using MemcpyableSooIntCustomAllocTable =
|
|
738
|
+
ValueTable<int64_t, /*kTransferable=*/true, /*kSoo=*/true,
|
|
739
|
+
ChangingSizeAndTrackingTypeAlloc<int64_t>>;
|
|
740
|
+
using NonMemcpyableSooIntCustomAllocTable =
|
|
741
|
+
ValueTable<int64_t, /*kTransferable=*/false, /*kSoo=*/true,
|
|
742
|
+
ChangingSizeAndTrackingTypeAlloc<int64_t>>;
|
|
743
|
+
|
|
744
|
+
TEST(Table, EmptyFunctorOptimization) {
|
|
745
|
+
static_assert(std::is_empty<std::equal_to<absl::string_view>>::value, "");
|
|
746
|
+
static_assert(std::is_empty<std::allocator<int>>::value, "");
|
|
747
|
+
|
|
748
|
+
struct MockTable {
|
|
749
|
+
size_t capacity;
|
|
750
|
+
uint64_t size;
|
|
751
|
+
void* ctrl;
|
|
752
|
+
void* slots;
|
|
753
|
+
};
|
|
754
|
+
struct StatelessHash {
|
|
755
|
+
size_t operator()(absl::string_view) const { return 0; }
|
|
756
|
+
};
|
|
757
|
+
struct StatefulHash : StatelessHash {
|
|
758
|
+
uint64_t dummy;
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
struct GenerationData {
|
|
762
|
+
size_t reserved_growth;
|
|
763
|
+
size_t reservation_size;
|
|
764
|
+
GenerationType* generation;
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
// Ignore unreachable-code warning. Compiler thinks one branch of each ternary
|
|
768
|
+
// conditional is unreachable.
|
|
769
|
+
#if defined(__clang__)
|
|
770
|
+
#pragma clang diagnostic push
|
|
771
|
+
#pragma clang diagnostic ignored "-Wunreachable-code"
|
|
772
|
+
#endif
|
|
773
|
+
constexpr size_t mock_size = sizeof(MockTable);
|
|
774
|
+
constexpr size_t generation_size =
|
|
775
|
+
SwisstableGenerationsEnabled() ? sizeof(GenerationData) : 0;
|
|
776
|
+
#if defined(__clang__)
|
|
777
|
+
#pragma clang diagnostic pop
|
|
778
|
+
#endif
|
|
779
|
+
|
|
780
|
+
EXPECT_EQ(
|
|
781
|
+
mock_size + generation_size,
|
|
782
|
+
sizeof(
|
|
783
|
+
raw_hash_set<StringPolicy, StatelessHash,
|
|
784
|
+
std::equal_to<absl::string_view>, std::allocator<int>>));
|
|
785
|
+
|
|
786
|
+
EXPECT_EQ(
|
|
787
|
+
mock_size + sizeof(StatefulHash) + generation_size,
|
|
788
|
+
sizeof(
|
|
789
|
+
raw_hash_set<StringPolicy, StatefulHash,
|
|
790
|
+
std::equal_to<absl::string_view>, std::allocator<int>>));
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
TEST(InstantiateRawHashSetTest, VerifyTypes) {
|
|
794
|
+
using P = ValuePolicy<int>;
|
|
795
|
+
using DA = typename P::DefaultHash;
|
|
796
|
+
using DB = typename P::DefaultEq;
|
|
797
|
+
using DC = typename P::DefaultAlloc;
|
|
798
|
+
|
|
799
|
+
struct A {};
|
|
800
|
+
struct B {};
|
|
801
|
+
struct C {};
|
|
802
|
+
|
|
803
|
+
EXPECT_TRUE((std::is_same_v<InstantiateRawHashSet<P, A, B, C>::type,
|
|
804
|
+
raw_hash_set<P, A, B, C>>));
|
|
805
|
+
EXPECT_TRUE((std::is_same_v<InstantiateRawHashSet<P, A, B, DC>::type,
|
|
806
|
+
raw_hash_set<P, A, B>>));
|
|
807
|
+
EXPECT_TRUE((std::is_same_v<InstantiateRawHashSet<P, A, DB, C>::type,
|
|
808
|
+
raw_hash_set<P, A, DB, C>>));
|
|
809
|
+
EXPECT_TRUE((std::is_same_v<InstantiateRawHashSet<P, A, DB, DC>::type,
|
|
810
|
+
raw_hash_set<P, A>>));
|
|
811
|
+
EXPECT_TRUE((std::is_same_v<InstantiateRawHashSet<P, DA, B, C>::type,
|
|
812
|
+
raw_hash_set<P, DA, B, C>>));
|
|
813
|
+
EXPECT_TRUE((std::is_same_v<InstantiateRawHashSet<P, DA, B, DC>::type,
|
|
814
|
+
raw_hash_set<P, DA, B>>));
|
|
815
|
+
EXPECT_TRUE((std::is_same_v<InstantiateRawHashSet<P, DA, DB, C>::type,
|
|
816
|
+
raw_hash_set<P, DA, DB, C>>));
|
|
817
|
+
EXPECT_TRUE((std::is_same_v<InstantiateRawHashSet<P, DA, DB, DC>::type,
|
|
818
|
+
raw_hash_set<P>>));
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
template <class TableType>
|
|
822
|
+
class SooTest : public testing::Test {};
|
|
823
|
+
|
|
824
|
+
using SooTableTypes =
|
|
825
|
+
::testing::Types<SooIntTable, NonSooIntTable, NonMemcpyableSooIntTable,
|
|
826
|
+
MemcpyableSooIntCustomAllocTable,
|
|
827
|
+
NonMemcpyableSooIntCustomAllocTable>;
|
|
828
|
+
TYPED_TEST_SUITE(SooTest, SooTableTypes);
|
|
829
|
+
|
|
830
|
+
TYPED_TEST(SooTest, Empty) {
|
|
831
|
+
TypeParam t;
|
|
832
|
+
EXPECT_EQ(0, t.size());
|
|
833
|
+
EXPECT_TRUE(t.empty());
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
TEST(Table, Prefetch) {
|
|
837
|
+
IntTable t;
|
|
838
|
+
t.emplace(1);
|
|
839
|
+
// Works for both present and absent keys.
|
|
840
|
+
t.prefetch(1);
|
|
841
|
+
t.prefetch(2);
|
|
842
|
+
|
|
843
|
+
static constexpr int size = 10;
|
|
844
|
+
for (int i = 0; i < size; ++i) t.insert(i);
|
|
845
|
+
for (int i = 0; i < size; ++i) {
|
|
846
|
+
t.prefetch(i);
|
|
847
|
+
ASSERT_TRUE(t.find(i) != t.end()) << i;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
TYPED_TEST(SooTest, LookupEmpty) {
|
|
852
|
+
TypeParam t;
|
|
853
|
+
auto it = t.find(0);
|
|
854
|
+
EXPECT_TRUE(it == t.end());
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
TYPED_TEST(SooTest, Insert1) {
|
|
858
|
+
TypeParam t;
|
|
859
|
+
EXPECT_TRUE(t.find(0) == t.end());
|
|
860
|
+
auto res = t.emplace(0);
|
|
861
|
+
EXPECT_TRUE(res.second);
|
|
862
|
+
EXPECT_THAT(*res.first, 0);
|
|
863
|
+
EXPECT_EQ(1, t.size());
|
|
864
|
+
EXPECT_THAT(*t.find(0), 0);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
TYPED_TEST(SooTest, Insert2) {
|
|
868
|
+
TypeParam t;
|
|
869
|
+
EXPECT_TRUE(t.find(0) == t.end());
|
|
870
|
+
auto res = t.emplace(0);
|
|
871
|
+
EXPECT_TRUE(res.second);
|
|
872
|
+
EXPECT_THAT(*res.first, 0);
|
|
873
|
+
EXPECT_EQ(1, t.size());
|
|
874
|
+
EXPECT_TRUE(t.find(1) == t.end());
|
|
875
|
+
res = t.emplace(1);
|
|
876
|
+
EXPECT_TRUE(res.second);
|
|
877
|
+
EXPECT_THAT(*res.first, 1);
|
|
878
|
+
EXPECT_EQ(2, t.size());
|
|
879
|
+
EXPECT_THAT(*t.find(0), 0);
|
|
880
|
+
EXPECT_THAT(*t.find(1), 1);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
TEST(Table, InsertCollision) {
|
|
884
|
+
BadTable t;
|
|
885
|
+
EXPECT_TRUE(t.find(1) == t.end());
|
|
886
|
+
auto res = t.emplace(1);
|
|
887
|
+
EXPECT_TRUE(res.second);
|
|
888
|
+
EXPECT_THAT(*res.first, 1);
|
|
889
|
+
EXPECT_EQ(1, t.size());
|
|
890
|
+
|
|
891
|
+
EXPECT_TRUE(t.find(2) == t.end());
|
|
892
|
+
res = t.emplace(2);
|
|
893
|
+
EXPECT_THAT(*res.first, 2);
|
|
894
|
+
EXPECT_TRUE(res.second);
|
|
895
|
+
EXPECT_EQ(2, t.size());
|
|
896
|
+
|
|
897
|
+
EXPECT_THAT(*t.find(1), 1);
|
|
898
|
+
EXPECT_THAT(*t.find(2), 2);
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// Test that we do not add existent element in case we need to search through
|
|
902
|
+
// many groups with deleted elements
|
|
903
|
+
TEST(Table, InsertCollisionAndFindAfterDelete) {
|
|
904
|
+
BadTable t; // all elements go to the same group.
|
|
905
|
+
// Have at least 2 groups with Group::kWidth collisions
|
|
906
|
+
// plus some extra collisions in the last group.
|
|
907
|
+
constexpr size_t kNumInserts = Group::kWidth * 2 + 5;
|
|
908
|
+
for (size_t i = 0; i < kNumInserts; ++i) {
|
|
909
|
+
auto res = t.emplace(i);
|
|
910
|
+
EXPECT_TRUE(res.second);
|
|
911
|
+
EXPECT_THAT(*res.first, i);
|
|
912
|
+
EXPECT_EQ(i + 1, t.size());
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
// Remove elements one by one and check
|
|
916
|
+
// that we still can find all other elements.
|
|
917
|
+
for (size_t i = 0; i < kNumInserts; ++i) {
|
|
918
|
+
EXPECT_EQ(1, t.erase(i)) << i;
|
|
919
|
+
for (size_t j = i + 1; j < kNumInserts; ++j) {
|
|
920
|
+
EXPECT_THAT(*t.find(j), j);
|
|
921
|
+
auto res = t.emplace(j);
|
|
922
|
+
EXPECT_FALSE(res.second) << i << " " << j;
|
|
923
|
+
EXPECT_THAT(*res.first, j);
|
|
924
|
+
EXPECT_EQ(kNumInserts - i - 1, t.size());
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
EXPECT_TRUE(t.empty());
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
TYPED_TEST(SooTest, EraseInSmallTables) {
|
|
931
|
+
for (int64_t size = 0; size < 64; ++size) {
|
|
932
|
+
TypeParam t;
|
|
933
|
+
for (int64_t i = 0; i < size; ++i) {
|
|
934
|
+
t.insert(i);
|
|
935
|
+
}
|
|
936
|
+
for (int64_t i = 0; i < size; ++i) {
|
|
937
|
+
t.erase(i);
|
|
938
|
+
EXPECT_EQ(t.size(), size - i - 1);
|
|
939
|
+
for (int64_t j = i + 1; j < size; ++j) {
|
|
940
|
+
EXPECT_THAT(*t.find(j), j);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
EXPECT_TRUE(t.empty());
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
TYPED_TEST(SooTest, InsertWithinCapacity) {
|
|
948
|
+
TypeParam t;
|
|
949
|
+
t.reserve(10);
|
|
950
|
+
const size_t original_capacity = t.capacity();
|
|
951
|
+
const auto addr = [&](int i) {
|
|
952
|
+
return reinterpret_cast<uintptr_t>(&*t.find(i));
|
|
953
|
+
};
|
|
954
|
+
// Inserting an element does not change capacity.
|
|
955
|
+
t.insert(0);
|
|
956
|
+
EXPECT_THAT(t.capacity(), original_capacity);
|
|
957
|
+
const uintptr_t original_addr_0 = addr(0);
|
|
958
|
+
// Inserting another element does not rehash.
|
|
959
|
+
t.insert(1);
|
|
960
|
+
EXPECT_THAT(t.capacity(), original_capacity);
|
|
961
|
+
EXPECT_THAT(addr(0), original_addr_0);
|
|
962
|
+
// Inserting lots of duplicate elements does not rehash.
|
|
963
|
+
for (int i = 0; i < 100; ++i) {
|
|
964
|
+
t.insert(i % 10);
|
|
965
|
+
}
|
|
966
|
+
EXPECT_THAT(t.capacity(), original_capacity);
|
|
967
|
+
EXPECT_THAT(addr(0), original_addr_0);
|
|
968
|
+
// Inserting a range of duplicate elements does not rehash.
|
|
969
|
+
std::vector<int> dup_range;
|
|
970
|
+
for (int i = 0; i < 100; ++i) {
|
|
971
|
+
dup_range.push_back(i % 10);
|
|
972
|
+
}
|
|
973
|
+
t.insert(dup_range.begin(), dup_range.end());
|
|
974
|
+
EXPECT_THAT(t.capacity(), original_capacity);
|
|
975
|
+
EXPECT_THAT(addr(0), original_addr_0);
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
template <class TableType>
|
|
979
|
+
class SmallTableResizeTest : public testing::Test {};
|
|
980
|
+
|
|
981
|
+
using SmallTableTypes = ::testing::Types<
|
|
982
|
+
IntTable, TransferableIntTable, SooIntTable,
|
|
983
|
+
// int8
|
|
984
|
+
ValueTable<int8_t, /*kTransferable=*/true, /*kSoo=*/true>,
|
|
985
|
+
ValueTable<int8_t, /*kTransferable=*/false, /*kSoo=*/true>,
|
|
986
|
+
// int16
|
|
987
|
+
ValueTable<int16_t, /*kTransferable=*/true, /*kSoo=*/true>,
|
|
988
|
+
ValueTable<int16_t, /*kTransferable=*/false, /*kSoo=*/true>,
|
|
989
|
+
// int128
|
|
990
|
+
ValueTable<SizedValue<16>, /*kTransferable=*/true, /*kSoo=*/true>,
|
|
991
|
+
ValueTable<SizedValue<16>, /*kTransferable=*/false, /*kSoo=*/true>,
|
|
992
|
+
// int192
|
|
993
|
+
ValueTable<SizedValue<24>, /*kTransferable=*/true, /*kSoo=*/true>,
|
|
994
|
+
ValueTable<SizedValue<24>, /*kTransferable=*/false, /*kSoo=*/true>,
|
|
995
|
+
// Special tables.
|
|
996
|
+
MinimumAlignmentUint8Table, CustomAllocIntTable, ChangingSizeAllocIntTable,
|
|
997
|
+
BadTable,
|
|
998
|
+
// alignment 1, size 2.
|
|
999
|
+
ValueTable<AlignedValue<uint8_t, 2>, /*kTransferable=*/true, /*kSoo=*/true>,
|
|
1000
|
+
ValueTable<AlignedValue<uint8_t, 2>, /*kTransferable=*/false,
|
|
1001
|
+
/*kSoo=*/true>,
|
|
1002
|
+
// alignment 1, size 7.
|
|
1003
|
+
ValueTable<AlignedValue<uint8_t, 7>, /*kTransferable=*/true, /*kSoo=*/true>,
|
|
1004
|
+
ValueTable<AlignedValue<uint8_t, 7>, /*kTransferable=*/false,
|
|
1005
|
+
/*kSoo=*/true>,
|
|
1006
|
+
// alignment 2, size 6.
|
|
1007
|
+
ValueTable<AlignedValue<uint16_t, 3>, /*kTransferable=*/true,
|
|
1008
|
+
/*kSoo=*/true>,
|
|
1009
|
+
ValueTable<AlignedValue<uint16_t, 3>, /*kTransferable=*/false,
|
|
1010
|
+
/*kSoo=*/true>,
|
|
1011
|
+
// alignment 2, size 10.
|
|
1012
|
+
ValueTable<AlignedValue<uint16_t, 5>, /*kTransferable=*/true,
|
|
1013
|
+
/*kSoo=*/true>,
|
|
1014
|
+
ValueTable<AlignedValue<uint16_t, 5>, /*kTransferable=*/false,
|
|
1015
|
+
/*kSoo=*/true>>;
|
|
1016
|
+
TYPED_TEST_SUITE(SmallTableResizeTest, SmallTableTypes);
|
|
1017
|
+
|
|
1018
|
+
TYPED_TEST(SmallTableResizeTest, InsertIntoSmallTable) {
|
|
1019
|
+
TypeParam t;
|
|
1020
|
+
for (int i = 0; i < 32; ++i) {
|
|
1021
|
+
t.insert(i);
|
|
1022
|
+
ASSERT_EQ(t.size(), i + 1);
|
|
1023
|
+
for (int j = 0; j < i + 1; ++j) {
|
|
1024
|
+
ASSERT_TRUE(t.find(j) != t.end());
|
|
1025
|
+
EXPECT_EQ(*t.find(j), j);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
TYPED_TEST(SmallTableResizeTest, ResizeGrowSmallTables) {
|
|
1031
|
+
for (size_t source_size = 0; source_size < 32; ++source_size) {
|
|
1032
|
+
for (size_t target_size = source_size; target_size < 32; ++target_size) {
|
|
1033
|
+
for (bool rehash : {false, true}) {
|
|
1034
|
+
SCOPED_TRACE(absl::StrCat("source_size: ", source_size,
|
|
1035
|
+
", target_size: ", target_size,
|
|
1036
|
+
", rehash: ", rehash));
|
|
1037
|
+
TypeParam t;
|
|
1038
|
+
for (size_t i = 0; i < source_size; ++i) {
|
|
1039
|
+
t.insert(static_cast<int>(i));
|
|
1040
|
+
}
|
|
1041
|
+
if (rehash) {
|
|
1042
|
+
t.rehash(target_size);
|
|
1043
|
+
} else {
|
|
1044
|
+
t.reserve(target_size);
|
|
1045
|
+
}
|
|
1046
|
+
for (size_t i = 0; i < source_size; ++i) {
|
|
1047
|
+
ASSERT_TRUE(t.find(static_cast<int>(i)) != t.end());
|
|
1048
|
+
EXPECT_EQ(*t.find(static_cast<int>(i)), static_cast<int>(i));
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
TYPED_TEST(SmallTableResizeTest, ResizeReduceSmallTables) {
|
|
1056
|
+
DisableSampling();
|
|
1057
|
+
for (size_t source_size = 0; source_size < 32; ++source_size) {
|
|
1058
|
+
for (size_t target_size = 0; target_size <= source_size; ++target_size) {
|
|
1059
|
+
TypeParam t;
|
|
1060
|
+
size_t inserted_count = std::min<size_t>(source_size, 5);
|
|
1061
|
+
for (size_t i = 0; i < inserted_count; ++i) {
|
|
1062
|
+
t.insert(static_cast<int>(i));
|
|
1063
|
+
}
|
|
1064
|
+
const size_t minimum_capacity = t.capacity();
|
|
1065
|
+
t.reserve(source_size);
|
|
1066
|
+
t.rehash(target_size);
|
|
1067
|
+
if (target_size == 0) {
|
|
1068
|
+
EXPECT_EQ(t.capacity(), minimum_capacity)
|
|
1069
|
+
<< "rehash(0) must resize to the minimum capacity";
|
|
1070
|
+
}
|
|
1071
|
+
for (size_t i = 0; i < inserted_count; ++i) {
|
|
1072
|
+
ASSERT_TRUE(t.find(static_cast<int>(i)) != t.end());
|
|
1073
|
+
EXPECT_EQ(*t.find(static_cast<int>(i)), static_cast<int>(i));
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
TEST(Table, LazyEmplace) {
|
|
1080
|
+
StringTable t;
|
|
1081
|
+
bool called = false;
|
|
1082
|
+
auto it = t.lazy_emplace("abc", [&](const StringTable::constructor& f) {
|
|
1083
|
+
called = true;
|
|
1084
|
+
f("abc", "ABC");
|
|
1085
|
+
});
|
|
1086
|
+
EXPECT_TRUE(called);
|
|
1087
|
+
EXPECT_THAT(*it, Pair("abc", "ABC"));
|
|
1088
|
+
called = false;
|
|
1089
|
+
it = t.lazy_emplace("abc", [&](const StringTable::constructor& f) {
|
|
1090
|
+
called = true;
|
|
1091
|
+
f("abc", "DEF");
|
|
1092
|
+
});
|
|
1093
|
+
EXPECT_FALSE(called);
|
|
1094
|
+
EXPECT_THAT(*it, Pair("abc", "ABC"));
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
TYPED_TEST(SooTest, ContainsEmpty) {
|
|
1098
|
+
TypeParam t;
|
|
1099
|
+
|
|
1100
|
+
EXPECT_FALSE(t.contains(0));
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
TYPED_TEST(SooTest, Contains1) {
|
|
1104
|
+
TypeParam t;
|
|
1105
|
+
|
|
1106
|
+
EXPECT_TRUE(t.insert(0).second);
|
|
1107
|
+
EXPECT_TRUE(t.contains(0));
|
|
1108
|
+
EXPECT_FALSE(t.contains(1));
|
|
1109
|
+
|
|
1110
|
+
EXPECT_EQ(1, t.erase(0));
|
|
1111
|
+
EXPECT_FALSE(t.contains(0));
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
TYPED_TEST(SooTest, Contains2) {
|
|
1115
|
+
TypeParam t;
|
|
1116
|
+
|
|
1117
|
+
EXPECT_TRUE(t.insert(0).second);
|
|
1118
|
+
EXPECT_TRUE(t.contains(0));
|
|
1119
|
+
EXPECT_FALSE(t.contains(1));
|
|
1120
|
+
|
|
1121
|
+
t.clear();
|
|
1122
|
+
EXPECT_FALSE(t.contains(0));
|
|
1123
|
+
|
|
1124
|
+
EXPECT_TRUE(t.insert(0).second);
|
|
1125
|
+
EXPECT_TRUE(t.contains(0));
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
int decompose_constructed;
|
|
1129
|
+
int decompose_copy_constructed;
|
|
1130
|
+
int decompose_copy_assigned;
|
|
1131
|
+
int decompose_move_constructed;
|
|
1132
|
+
int decompose_move_assigned;
|
|
1133
|
+
struct DecomposeType {
|
|
1134
|
+
DecomposeType(int i = 0) : i(i) { // NOLINT
|
|
1135
|
+
++decompose_constructed;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
explicit DecomposeType(const char* d) : DecomposeType(*d) {}
|
|
1139
|
+
|
|
1140
|
+
DecomposeType(const DecomposeType& other) : i(other.i) {
|
|
1141
|
+
++decompose_copy_constructed;
|
|
1142
|
+
}
|
|
1143
|
+
DecomposeType& operator=(const DecomposeType& other) {
|
|
1144
|
+
++decompose_copy_assigned;
|
|
1145
|
+
i = other.i;
|
|
1146
|
+
return *this;
|
|
1147
|
+
}
|
|
1148
|
+
DecomposeType(DecomposeType&& other) : i(other.i) {
|
|
1149
|
+
++decompose_move_constructed;
|
|
1150
|
+
}
|
|
1151
|
+
DecomposeType& operator=(DecomposeType&& other) {
|
|
1152
|
+
++decompose_move_assigned;
|
|
1153
|
+
i = other.i;
|
|
1154
|
+
return *this;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
int i;
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1160
|
+
struct DecomposeHash {
|
|
1161
|
+
using is_transparent = void;
|
|
1162
|
+
size_t operator()(const DecomposeType& a) const { return a.i; }
|
|
1163
|
+
size_t operator()(int a) const { return a; }
|
|
1164
|
+
size_t operator()(const char* a) const { return *a; }
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
struct DecomposeEq {
|
|
1168
|
+
using is_transparent = void;
|
|
1169
|
+
bool operator()(const DecomposeType& a, const DecomposeType& b) const {
|
|
1170
|
+
return a.i == b.i;
|
|
1171
|
+
}
|
|
1172
|
+
bool operator()(const DecomposeType& a, int b) const { return a.i == b; }
|
|
1173
|
+
bool operator()(const DecomposeType& a, const char* b) const {
|
|
1174
|
+
return a.i == *b;
|
|
1175
|
+
}
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1178
|
+
struct DecomposePolicy {
|
|
1179
|
+
using slot_type = DecomposeType;
|
|
1180
|
+
using key_type = DecomposeType;
|
|
1181
|
+
using init_type = DecomposeType;
|
|
1182
|
+
|
|
1183
|
+
using DefaultHash = void;
|
|
1184
|
+
using DefaultEq = void;
|
|
1185
|
+
using DefaultAlloc = void;
|
|
1186
|
+
|
|
1187
|
+
template <typename T>
|
|
1188
|
+
static void construct(void*, DecomposeType* slot, T&& v) {
|
|
1189
|
+
::new (slot) DecomposeType(std::forward<T>(v));
|
|
1190
|
+
}
|
|
1191
|
+
static void destroy(void*, DecomposeType* slot) { slot->~DecomposeType(); }
|
|
1192
|
+
static DecomposeType& element(slot_type* slot) { return *slot; }
|
|
1193
|
+
|
|
1194
|
+
template <class F, class T>
|
|
1195
|
+
static auto apply(F&& f, const T& x) -> decltype(std::forward<F>(f)(x, x)) {
|
|
1196
|
+
return std::forward<F>(f)(x, x);
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
template <class Hash, bool kIsDefault>
|
|
1200
|
+
static constexpr HashSlotFn get_hash_slot_fn() {
|
|
1201
|
+
return nullptr;
|
|
1202
|
+
}
|
|
1203
|
+
};
|
|
1204
|
+
|
|
1205
|
+
template <typename Hash, typename Eq>
|
|
1206
|
+
void TestDecompose(bool construct_three) {
|
|
1207
|
+
DecomposeType elem{0};
|
|
1208
|
+
const int one = 1;
|
|
1209
|
+
const char* three_p = "3";
|
|
1210
|
+
const auto& three = three_p;
|
|
1211
|
+
const int elem_vector_count = 256;
|
|
1212
|
+
std::vector<DecomposeType> elem_vector(elem_vector_count, DecomposeType{0});
|
|
1213
|
+
std::iota(elem_vector.begin(), elem_vector.end(), 0);
|
|
1214
|
+
|
|
1215
|
+
using DecomposeSet =
|
|
1216
|
+
raw_hash_set<DecomposePolicy, Hash, Eq, std::allocator<int>>;
|
|
1217
|
+
DecomposeSet set1;
|
|
1218
|
+
|
|
1219
|
+
decompose_constructed = 0;
|
|
1220
|
+
int expected_constructed = 0;
|
|
1221
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1222
|
+
set1.insert(elem);
|
|
1223
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1224
|
+
set1.insert(1);
|
|
1225
|
+
EXPECT_EQ(++expected_constructed, decompose_constructed);
|
|
1226
|
+
set1.emplace("3");
|
|
1227
|
+
EXPECT_EQ(++expected_constructed, decompose_constructed);
|
|
1228
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1229
|
+
|
|
1230
|
+
{ // insert(T&&)
|
|
1231
|
+
set1.insert(1);
|
|
1232
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
{ // insert(const T&)
|
|
1236
|
+
set1.insert(one);
|
|
1237
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
{ // insert(hint, T&&)
|
|
1241
|
+
set1.insert(set1.begin(), 1);
|
|
1242
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
{ // insert(hint, const T&)
|
|
1246
|
+
set1.insert(set1.begin(), one);
|
|
1247
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
{ // emplace(...)
|
|
1251
|
+
set1.emplace(1);
|
|
1252
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1253
|
+
set1.emplace("3");
|
|
1254
|
+
expected_constructed += construct_three;
|
|
1255
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1256
|
+
set1.emplace(one);
|
|
1257
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1258
|
+
set1.emplace(three);
|
|
1259
|
+
expected_constructed += construct_three;
|
|
1260
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
{ // emplace_hint(...)
|
|
1264
|
+
set1.emplace_hint(set1.begin(), 1);
|
|
1265
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1266
|
+
set1.emplace_hint(set1.begin(), "3");
|
|
1267
|
+
expected_constructed += construct_three;
|
|
1268
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1269
|
+
set1.emplace_hint(set1.begin(), one);
|
|
1270
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1271
|
+
set1.emplace_hint(set1.begin(), three);
|
|
1272
|
+
expected_constructed += construct_three;
|
|
1273
|
+
EXPECT_EQ(expected_constructed, decompose_constructed);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
decompose_copy_constructed = 0;
|
|
1277
|
+
decompose_copy_assigned = 0;
|
|
1278
|
+
decompose_move_constructed = 0;
|
|
1279
|
+
decompose_move_assigned = 0;
|
|
1280
|
+
int expected_copy_constructed = 0;
|
|
1281
|
+
int expected_move_constructed = 0;
|
|
1282
|
+
{ // raw_hash_set(first, last) with random-access iterators
|
|
1283
|
+
DecomposeSet set2(elem_vector.begin(), elem_vector.end());
|
|
1284
|
+
// Expect exactly one copy-constructor call for each element if no
|
|
1285
|
+
// rehashing is done.
|
|
1286
|
+
expected_copy_constructed += elem_vector_count;
|
|
1287
|
+
EXPECT_EQ(expected_copy_constructed, decompose_copy_constructed);
|
|
1288
|
+
EXPECT_EQ(expected_move_constructed, decompose_move_constructed);
|
|
1289
|
+
EXPECT_EQ(0, decompose_move_assigned);
|
|
1290
|
+
EXPECT_EQ(0, decompose_copy_assigned);
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
{ // raw_hash_set(first, last) with forward iterators
|
|
1294
|
+
std::list<DecomposeType> elem_list(elem_vector.begin(), elem_vector.end());
|
|
1295
|
+
expected_copy_constructed = decompose_copy_constructed;
|
|
1296
|
+
DecomposeSet set2(elem_list.begin(), elem_list.end());
|
|
1297
|
+
// Expect exactly N elements copied into set, expect at most 2*N elements
|
|
1298
|
+
// moving internally for all resizing needed (for a growth factor of 2).
|
|
1299
|
+
expected_copy_constructed += elem_vector_count;
|
|
1300
|
+
EXPECT_EQ(expected_copy_constructed, decompose_copy_constructed);
|
|
1301
|
+
expected_move_constructed += elem_vector_count;
|
|
1302
|
+
EXPECT_LT(expected_move_constructed, decompose_move_constructed);
|
|
1303
|
+
expected_move_constructed += elem_vector_count;
|
|
1304
|
+
EXPECT_GE(expected_move_constructed, decompose_move_constructed);
|
|
1305
|
+
EXPECT_EQ(0, decompose_move_assigned);
|
|
1306
|
+
EXPECT_EQ(0, decompose_copy_assigned);
|
|
1307
|
+
expected_copy_constructed = decompose_copy_constructed;
|
|
1308
|
+
expected_move_constructed = decompose_move_constructed;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
{ // insert(first, last)
|
|
1312
|
+
DecomposeSet set2;
|
|
1313
|
+
set2.insert(elem_vector.begin(), elem_vector.end());
|
|
1314
|
+
// Expect exactly N elements copied into set, expect at most 2*N elements
|
|
1315
|
+
// moving internally for all resizing needed (for a growth factor of 2).
|
|
1316
|
+
const int expected_new_elements = elem_vector_count;
|
|
1317
|
+
const int expected_max_element_moves = 2 * elem_vector_count;
|
|
1318
|
+
expected_copy_constructed += expected_new_elements;
|
|
1319
|
+
EXPECT_EQ(expected_copy_constructed, decompose_copy_constructed);
|
|
1320
|
+
expected_move_constructed += expected_max_element_moves;
|
|
1321
|
+
EXPECT_GE(expected_move_constructed, decompose_move_constructed);
|
|
1322
|
+
EXPECT_EQ(0, decompose_move_assigned);
|
|
1323
|
+
EXPECT_EQ(0, decompose_copy_assigned);
|
|
1324
|
+
expected_copy_constructed = decompose_copy_constructed;
|
|
1325
|
+
expected_move_constructed = decompose_move_constructed;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
TEST(Table, Decompose) {
|
|
1330
|
+
if (SwisstableGenerationsEnabled()) {
|
|
1331
|
+
GTEST_SKIP() << "Generations being enabled causes extra rehashes.";
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
TestDecompose<DecomposeHash, DecomposeEq>(false);
|
|
1335
|
+
|
|
1336
|
+
struct TransparentHashIntOverload {
|
|
1337
|
+
size_t operator()(const DecomposeType& a) const { return a.i; }
|
|
1338
|
+
size_t operator()(int a) const { return a; }
|
|
1339
|
+
};
|
|
1340
|
+
struct TransparentEqIntOverload {
|
|
1341
|
+
bool operator()(const DecomposeType& a, const DecomposeType& b) const {
|
|
1342
|
+
return a.i == b.i;
|
|
1343
|
+
}
|
|
1344
|
+
bool operator()(const DecomposeType& a, int b) const { return a.i == b; }
|
|
1345
|
+
};
|
|
1346
|
+
TestDecompose<TransparentHashIntOverload, DecomposeEq>(true);
|
|
1347
|
+
TestDecompose<TransparentHashIntOverload, TransparentEqIntOverload>(true);
|
|
1348
|
+
TestDecompose<DecomposeHash, TransparentEqIntOverload>(true);
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
// Returns the largest m such that a table with m elements has the same number
|
|
1352
|
+
// of buckets as a table with n elements.
|
|
1353
|
+
size_t MaxDensitySize(size_t n) {
|
|
1354
|
+
IntTable t;
|
|
1355
|
+
t.reserve(n);
|
|
1356
|
+
for (size_t i = 0; i != n; ++i) t.emplace(i);
|
|
1357
|
+
const size_t c = t.bucket_count();
|
|
1358
|
+
while (c == t.bucket_count()) t.emplace(n++);
|
|
1359
|
+
return t.size() - 1;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
struct Modulo1000Hash {
|
|
1363
|
+
size_t operator()(int64_t x) const { return static_cast<size_t>(x) % 1000; }
|
|
1364
|
+
};
|
|
1365
|
+
|
|
1366
|
+
struct Modulo1000HashTable
|
|
1367
|
+
: public raw_hash_set<IntPolicy, Modulo1000Hash, std::equal_to<int64_t>,
|
|
1368
|
+
std::allocator<int>> {};
|
|
1369
|
+
|
|
1370
|
+
// Test that rehash with no resize happen in case of many deleted slots.
|
|
1371
|
+
TEST(Table, RehashWithNoResize) {
|
|
1372
|
+
if (SwisstableGenerationsEnabled()) {
|
|
1373
|
+
GTEST_SKIP() << "Generations being enabled causes extra rehashes.";
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
Modulo1000HashTable t;
|
|
1377
|
+
// Adding the same length (and the same hash) strings
|
|
1378
|
+
// to have at least kMinFullGroups groups
|
|
1379
|
+
// with Group::kWidth collisions. Then fill up to MaxDensitySize;
|
|
1380
|
+
const size_t kMinFullGroups = 7;
|
|
1381
|
+
std::vector<int> keys;
|
|
1382
|
+
for (size_t i = 0; i < MaxDensitySize(Group::kWidth * kMinFullGroups); ++i) {
|
|
1383
|
+
int k = i * 1000;
|
|
1384
|
+
t.emplace(k);
|
|
1385
|
+
keys.push_back(k);
|
|
1386
|
+
}
|
|
1387
|
+
const size_t capacity = t.capacity();
|
|
1388
|
+
|
|
1389
|
+
// Remove elements from all groups except the first and the last one.
|
|
1390
|
+
// All elements removed from full groups will be marked as ctrl_t::kDeleted.
|
|
1391
|
+
const size_t erase_begin = Group::kWidth / 2;
|
|
1392
|
+
const size_t erase_end = (t.size() / Group::kWidth - 1) * Group::kWidth;
|
|
1393
|
+
for (size_t i = erase_begin; i < erase_end; ++i) {
|
|
1394
|
+
EXPECT_EQ(1, t.erase(keys[i])) << i;
|
|
1395
|
+
}
|
|
1396
|
+
keys.erase(keys.begin() + erase_begin, keys.begin() + erase_end);
|
|
1397
|
+
|
|
1398
|
+
auto last_key = keys.back();
|
|
1399
|
+
size_t last_key_num_probes = GetHashtableDebugNumProbes(t, last_key);
|
|
1400
|
+
|
|
1401
|
+
// Make sure that we have to make a lot of probes for last key.
|
|
1402
|
+
ASSERT_GT(last_key_num_probes, kMinFullGroups);
|
|
1403
|
+
|
|
1404
|
+
int x = 1;
|
|
1405
|
+
// Insert and erase one element, before inplace rehash happen.
|
|
1406
|
+
while (last_key_num_probes == GetHashtableDebugNumProbes(t, last_key)) {
|
|
1407
|
+
t.emplace(x);
|
|
1408
|
+
ASSERT_EQ(capacity, t.capacity());
|
|
1409
|
+
// All elements should be there.
|
|
1410
|
+
ASSERT_TRUE(t.find(x) != t.end()) << x;
|
|
1411
|
+
for (const auto& k : keys) {
|
|
1412
|
+
ASSERT_TRUE(t.find(k) != t.end()) << k;
|
|
1413
|
+
}
|
|
1414
|
+
t.erase(x);
|
|
1415
|
+
++x;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
TYPED_TEST(SooTest, InsertEraseStressTest) {
|
|
1420
|
+
TypeParam t;
|
|
1421
|
+
const size_t kMinElementCount = 50;
|
|
1422
|
+
std::deque<int> keys;
|
|
1423
|
+
size_t i = 0;
|
|
1424
|
+
for (; i < MaxDensitySize(kMinElementCount); ++i) {
|
|
1425
|
+
t.emplace(static_cast<int64_t>(i));
|
|
1426
|
+
keys.push_back(i);
|
|
1427
|
+
}
|
|
1428
|
+
const size_t kNumIterations = 20000;
|
|
1429
|
+
for (; i < kNumIterations; ++i) {
|
|
1430
|
+
ASSERT_EQ(1, t.erase(keys.front()));
|
|
1431
|
+
keys.pop_front();
|
|
1432
|
+
t.emplace(static_cast<int64_t>(i));
|
|
1433
|
+
keys.push_back(i);
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
TEST(Table, InsertOverloads) {
|
|
1438
|
+
StringTable t;
|
|
1439
|
+
// These should all trigger the insert(init_type) overload.
|
|
1440
|
+
t.insert({{}, {}});
|
|
1441
|
+
t.insert({"ABC", {}});
|
|
1442
|
+
t.insert({"DEF", "!!!"});
|
|
1443
|
+
|
|
1444
|
+
EXPECT_THAT(t, UnorderedElementsAre(Pair("", ""), Pair("ABC", ""),
|
|
1445
|
+
Pair("DEF", "!!!")));
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
TYPED_TEST(SooTest, LargeTable) {
|
|
1449
|
+
TypeParam t;
|
|
1450
|
+
for (int64_t i = 0; i != 10000; ++i) {
|
|
1451
|
+
t.emplace(i << 40);
|
|
1452
|
+
ASSERT_EQ(t.size(), i + 1);
|
|
1453
|
+
}
|
|
1454
|
+
for (int64_t i = 0; i != 10000; ++i)
|
|
1455
|
+
ASSERT_EQ(i << 40, static_cast<int64_t>(*t.find(i << 40)));
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
// Timeout if copy is quadratic as it was in Rust.
|
|
1459
|
+
TYPED_TEST(SooTest, EnsureNonQuadraticAsInRust) {
|
|
1460
|
+
static const size_t kLargeSize = 1 << 15;
|
|
1461
|
+
|
|
1462
|
+
TypeParam t;
|
|
1463
|
+
for (size_t i = 0; i != kLargeSize; ++i) {
|
|
1464
|
+
t.insert(i);
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
// If this is quadratic, the test will timeout.
|
|
1468
|
+
TypeParam t2;
|
|
1469
|
+
for (const auto& entry : t) t2.insert(entry);
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
TYPED_TEST(SooTest, ClearBug) {
|
|
1473
|
+
if (SwisstableGenerationsEnabled()) {
|
|
1474
|
+
GTEST_SKIP() << "Generations being enabled causes extra rehashes.";
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
TypeParam t;
|
|
1478
|
+
constexpr size_t capacity = container_internal::Group::kWidth - 1;
|
|
1479
|
+
constexpr size_t max_size = capacity / 2 + 1;
|
|
1480
|
+
for (size_t i = 0; i < max_size; ++i) {
|
|
1481
|
+
t.insert(i);
|
|
1482
|
+
}
|
|
1483
|
+
ASSERT_EQ(capacity, t.capacity());
|
|
1484
|
+
intptr_t original = reinterpret_cast<intptr_t>(&*t.find(2));
|
|
1485
|
+
t.clear();
|
|
1486
|
+
ASSERT_EQ(capacity, t.capacity());
|
|
1487
|
+
for (size_t i = 0; i < max_size; ++i) {
|
|
1488
|
+
t.insert(i);
|
|
1489
|
+
}
|
|
1490
|
+
ASSERT_EQ(capacity, t.capacity());
|
|
1491
|
+
intptr_t second = reinterpret_cast<intptr_t>(&*t.find(2));
|
|
1492
|
+
// We are checking that original and second are close enough to each other
|
|
1493
|
+
// that they are probably still in the same group. This is not strictly
|
|
1494
|
+
// guaranteed.
|
|
1495
|
+
EXPECT_LT(static_cast<size_t>(std::abs(original - second)),
|
|
1496
|
+
capacity * sizeof(typename TypeParam::value_type));
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
TYPED_TEST(SooTest, Erase) {
|
|
1500
|
+
TypeParam t;
|
|
1501
|
+
EXPECT_TRUE(t.find(0) == t.end());
|
|
1502
|
+
auto res = t.emplace(0);
|
|
1503
|
+
EXPECT_TRUE(res.second);
|
|
1504
|
+
EXPECT_EQ(1, t.size());
|
|
1505
|
+
t.erase(res.first);
|
|
1506
|
+
EXPECT_EQ(0, t.size());
|
|
1507
|
+
EXPECT_TRUE(t.find(0) == t.end());
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
TYPED_TEST(SooTest, EraseMaintainsValidIterator) {
|
|
1511
|
+
TypeParam t;
|
|
1512
|
+
const int kNumElements = 100;
|
|
1513
|
+
for (int i = 0; i < kNumElements; i++) {
|
|
1514
|
+
EXPECT_TRUE(t.emplace(i).second);
|
|
1515
|
+
}
|
|
1516
|
+
EXPECT_EQ(t.size(), kNumElements);
|
|
1517
|
+
|
|
1518
|
+
int num_erase_calls = 0;
|
|
1519
|
+
auto it = t.begin();
|
|
1520
|
+
while (it != t.end()) {
|
|
1521
|
+
t.erase(it++);
|
|
1522
|
+
num_erase_calls++;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
EXPECT_TRUE(t.empty());
|
|
1526
|
+
EXPECT_EQ(num_erase_calls, kNumElements);
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
TYPED_TEST(SooTest, EraseBeginEnd) {
|
|
1530
|
+
TypeParam t;
|
|
1531
|
+
for (int i = 0; i < 10; ++i) t.insert(i);
|
|
1532
|
+
EXPECT_EQ(t.size(), 10);
|
|
1533
|
+
t.erase(t.begin(), t.end());
|
|
1534
|
+
EXPECT_EQ(t.size(), 0);
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
// Collect N bad keys by following algorithm:
|
|
1538
|
+
// 1. Create an empty table and reserve it to 2 * N.
|
|
1539
|
+
// 2. Insert N random elements.
|
|
1540
|
+
// 3. Take first Group::kWidth - 1 to bad_keys array.
|
|
1541
|
+
// 4. Clear the table without resize.
|
|
1542
|
+
// 5. Go to point 2 while N keys not collected
|
|
1543
|
+
std::vector<int64_t> CollectBadMergeKeys(size_t N) {
|
|
1544
|
+
static constexpr int kGroupSize = Group::kWidth - 1;
|
|
1545
|
+
|
|
1546
|
+
auto topk_range = [](size_t b, size_t e,
|
|
1547
|
+
IntTable* t) -> std::vector<int64_t> {
|
|
1548
|
+
for (size_t i = b; i != e; ++i) {
|
|
1549
|
+
t->emplace(i);
|
|
1550
|
+
}
|
|
1551
|
+
std::vector<int64_t> res;
|
|
1552
|
+
res.reserve(kGroupSize);
|
|
1553
|
+
auto it = t->begin();
|
|
1554
|
+
for (size_t i = b; i != e && i != b + kGroupSize; ++i, ++it) {
|
|
1555
|
+
res.push_back(*it);
|
|
1556
|
+
}
|
|
1557
|
+
return res;
|
|
1558
|
+
};
|
|
1559
|
+
|
|
1560
|
+
std::vector<int64_t> bad_keys;
|
|
1561
|
+
bad_keys.reserve(N);
|
|
1562
|
+
IntTable t;
|
|
1563
|
+
t.reserve(N * 2);
|
|
1564
|
+
|
|
1565
|
+
for (size_t b = 0; bad_keys.size() < N; b += N) {
|
|
1566
|
+
auto keys = topk_range(b, b + N, &t);
|
|
1567
|
+
bad_keys.insert(bad_keys.end(), keys.begin(), keys.end());
|
|
1568
|
+
t.erase(t.begin(), t.end());
|
|
1569
|
+
EXPECT_TRUE(t.empty());
|
|
1570
|
+
}
|
|
1571
|
+
return bad_keys;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
struct ProbeStats {
|
|
1575
|
+
// Number of elements with specific probe length over all tested tables.
|
|
1576
|
+
std::vector<size_t> all_probes_histogram;
|
|
1577
|
+
// Ratios total_probe_length/size for every tested table.
|
|
1578
|
+
std::vector<double> single_table_ratios;
|
|
1579
|
+
|
|
1580
|
+
// Average ratio total_probe_length/size over tables.
|
|
1581
|
+
double AvgRatio() const {
|
|
1582
|
+
return std::accumulate(single_table_ratios.begin(),
|
|
1583
|
+
single_table_ratios.end(), 0.0) /
|
|
1584
|
+
single_table_ratios.size();
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
// Maximum ratio total_probe_length/size over tables.
|
|
1588
|
+
double MaxRatio() const {
|
|
1589
|
+
return *std::max_element(single_table_ratios.begin(),
|
|
1590
|
+
single_table_ratios.end());
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
// Percentile ratio total_probe_length/size over tables.
|
|
1594
|
+
double PercentileRatio(double Percentile = 0.95) const {
|
|
1595
|
+
auto r = single_table_ratios;
|
|
1596
|
+
auto mid = r.begin() + static_cast<size_t>(r.size() * Percentile);
|
|
1597
|
+
if (mid != r.end()) {
|
|
1598
|
+
std::nth_element(r.begin(), mid, r.end());
|
|
1599
|
+
return *mid;
|
|
1600
|
+
} else {
|
|
1601
|
+
return MaxRatio();
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
// Maximum probe length over all elements and all tables.
|
|
1606
|
+
size_t MaxProbe() const { return all_probes_histogram.size(); }
|
|
1607
|
+
|
|
1608
|
+
// Fraction of elements with specified probe length.
|
|
1609
|
+
std::vector<double> ProbeNormalizedHistogram() const {
|
|
1610
|
+
double total_elements = std::accumulate(all_probes_histogram.begin(),
|
|
1611
|
+
all_probes_histogram.end(), 0ull);
|
|
1612
|
+
std::vector<double> res;
|
|
1613
|
+
for (size_t p : all_probes_histogram) {
|
|
1614
|
+
res.push_back(p / total_elements);
|
|
1615
|
+
}
|
|
1616
|
+
return res;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
size_t PercentileProbe(double Percentile = 0.99) const {
|
|
1620
|
+
size_t idx = 0;
|
|
1621
|
+
for (double p : ProbeNormalizedHistogram()) {
|
|
1622
|
+
if (Percentile > p) {
|
|
1623
|
+
Percentile -= p;
|
|
1624
|
+
++idx;
|
|
1625
|
+
} else {
|
|
1626
|
+
return idx;
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
return idx;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
friend std::ostream& operator<<(std::ostream& out, const ProbeStats& s) {
|
|
1633
|
+
out << "{AvgRatio:" << s.AvgRatio() << ", MaxRatio:" << s.MaxRatio()
|
|
1634
|
+
<< ", PercentileRatio:" << s.PercentileRatio()
|
|
1635
|
+
<< ", MaxProbe:" << s.MaxProbe() << ", Probes=[";
|
|
1636
|
+
for (double p : s.ProbeNormalizedHistogram()) {
|
|
1637
|
+
out << p << ",";
|
|
1638
|
+
}
|
|
1639
|
+
out << "]}";
|
|
1640
|
+
|
|
1641
|
+
return out;
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
struct ExpectedStats {
|
|
1646
|
+
double avg_ratio;
|
|
1647
|
+
double max_ratio;
|
|
1648
|
+
std::vector<std::pair<double, double>> pecentile_ratios;
|
|
1649
|
+
std::vector<std::pair<double, double>> pecentile_probes;
|
|
1650
|
+
|
|
1651
|
+
friend std::ostream& operator<<(std::ostream& out, const ExpectedStats& s) {
|
|
1652
|
+
out << "{AvgRatio:" << s.avg_ratio << ", MaxRatio:" << s.max_ratio
|
|
1653
|
+
<< ", PercentileRatios: [";
|
|
1654
|
+
for (auto el : s.pecentile_ratios) {
|
|
1655
|
+
out << el.first << ":" << el.second << ", ";
|
|
1656
|
+
}
|
|
1657
|
+
out << "], PercentileProbes: [";
|
|
1658
|
+
for (auto el : s.pecentile_probes) {
|
|
1659
|
+
out << el.first << ":" << el.second << ", ";
|
|
1660
|
+
}
|
|
1661
|
+
out << "]}";
|
|
1662
|
+
|
|
1663
|
+
return out;
|
|
1664
|
+
}
|
|
1665
|
+
};
|
|
1666
|
+
|
|
1667
|
+
void VerifyStats(size_t size, const ExpectedStats& exp,
|
|
1668
|
+
const ProbeStats& stats) {
|
|
1669
|
+
EXPECT_LT(stats.AvgRatio(), exp.avg_ratio) << size << " " << stats;
|
|
1670
|
+
EXPECT_LT(stats.MaxRatio(), exp.max_ratio) << size << " " << stats;
|
|
1671
|
+
for (auto pr : exp.pecentile_ratios) {
|
|
1672
|
+
EXPECT_LE(stats.PercentileRatio(pr.first), pr.second)
|
|
1673
|
+
<< size << " " << pr.first << " " << stats;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
for (auto pr : exp.pecentile_probes) {
|
|
1677
|
+
EXPECT_LE(stats.PercentileProbe(pr.first), pr.second)
|
|
1678
|
+
<< size << " " << pr.first << " " << stats;
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
using ProbeStatsPerSize = std::map<size_t, ProbeStats>;
|
|
1683
|
+
|
|
1684
|
+
// Collect total ProbeStats on num_iters iterations of the following algorithm:
|
|
1685
|
+
// 1. Create new table and reserve it to keys.size() * 2
|
|
1686
|
+
// 2. Insert all keys xored with seed
|
|
1687
|
+
// 3. Collect ProbeStats from final table.
|
|
1688
|
+
ProbeStats CollectProbeStatsOnKeysXoredWithSeed(
|
|
1689
|
+
const std::vector<int64_t>& keys, size_t num_iters) {
|
|
1690
|
+
const size_t reserve_size = keys.size() * 2;
|
|
1691
|
+
|
|
1692
|
+
ProbeStats stats;
|
|
1693
|
+
|
|
1694
|
+
int64_t seed = 0x71b1a19b907d6e33;
|
|
1695
|
+
while (num_iters--) {
|
|
1696
|
+
seed = static_cast<int64_t>(static_cast<uint64_t>(seed) * 17 + 13);
|
|
1697
|
+
IntTable t1;
|
|
1698
|
+
t1.reserve(reserve_size);
|
|
1699
|
+
for (const auto& key : keys) {
|
|
1700
|
+
t1.emplace(key ^ seed);
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
auto probe_histogram = GetHashtableDebugNumProbesHistogram(t1);
|
|
1704
|
+
stats.all_probes_histogram.resize(
|
|
1705
|
+
std::max(stats.all_probes_histogram.size(), probe_histogram.size()));
|
|
1706
|
+
std::transform(probe_histogram.begin(), probe_histogram.end(),
|
|
1707
|
+
stats.all_probes_histogram.begin(),
|
|
1708
|
+
stats.all_probes_histogram.begin(), std::plus<size_t>());
|
|
1709
|
+
|
|
1710
|
+
size_t total_probe_seq_length = 0;
|
|
1711
|
+
for (size_t i = 0; i < probe_histogram.size(); ++i) {
|
|
1712
|
+
total_probe_seq_length += i * probe_histogram[i];
|
|
1713
|
+
}
|
|
1714
|
+
stats.single_table_ratios.push_back(total_probe_seq_length * 1.0 /
|
|
1715
|
+
keys.size());
|
|
1716
|
+
t1.erase(t1.begin(), t1.end());
|
|
1717
|
+
}
|
|
1718
|
+
return stats;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
ExpectedStats XorSeedExpectedStats() {
|
|
1722
|
+
constexpr bool kRandomizesInserts =
|
|
1723
|
+
#ifdef NDEBUG
|
|
1724
|
+
false;
|
|
1725
|
+
#else // NDEBUG
|
|
1726
|
+
true;
|
|
1727
|
+
#endif // NDEBUG
|
|
1728
|
+
|
|
1729
|
+
// The effective load factor is larger in non-opt mode because we insert
|
|
1730
|
+
// elements out of order.
|
|
1731
|
+
switch (container_internal::Group::kWidth) {
|
|
1732
|
+
case 8:
|
|
1733
|
+
if (kRandomizesInserts) {
|
|
1734
|
+
return {0.05,
|
|
1735
|
+
1.0,
|
|
1736
|
+
{{0.95, 0.5}},
|
|
1737
|
+
{{0.95, 0}, {0.99, 2}, {0.999, 4}, {0.9999, 10}}};
|
|
1738
|
+
} else {
|
|
1739
|
+
return {0.05,
|
|
1740
|
+
2.0,
|
|
1741
|
+
{{0.95, 0.1}},
|
|
1742
|
+
{{0.95, 0}, {0.99, 2}, {0.999, 4}, {0.9999, 10}}};
|
|
1743
|
+
}
|
|
1744
|
+
case 16:
|
|
1745
|
+
if (kRandomizesInserts) {
|
|
1746
|
+
return {0.1,
|
|
1747
|
+
2.0,
|
|
1748
|
+
{{0.95, 0.1}},
|
|
1749
|
+
{{0.95, 0}, {0.99, 1}, {0.999, 8}, {0.9999, 15}}};
|
|
1750
|
+
} else {
|
|
1751
|
+
return {0.05,
|
|
1752
|
+
1.0,
|
|
1753
|
+
{{0.95, 0.05}},
|
|
1754
|
+
{{0.95, 0}, {0.99, 1}, {0.999, 4}, {0.9999, 10}}};
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
LOG(FATAL) << "Unknown Group width";
|
|
1758
|
+
return {};
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
// TODO(b/80415403): Figure out why this test is so flaky, esp. on MSVC
|
|
1762
|
+
TEST(Table, DISABLED_EnsureNonQuadraticTopNXorSeedByProbeSeqLength) {
|
|
1763
|
+
ProbeStatsPerSize stats;
|
|
1764
|
+
std::vector<size_t> sizes = {Group::kWidth << 5, Group::kWidth << 10};
|
|
1765
|
+
for (size_t size : sizes) {
|
|
1766
|
+
stats[size] =
|
|
1767
|
+
CollectProbeStatsOnKeysXoredWithSeed(CollectBadMergeKeys(size), 200);
|
|
1768
|
+
}
|
|
1769
|
+
auto expected = XorSeedExpectedStats();
|
|
1770
|
+
for (size_t size : sizes) {
|
|
1771
|
+
auto& stat = stats[size];
|
|
1772
|
+
VerifyStats(size, expected, stat);
|
|
1773
|
+
LOG(INFO) << size << " " << stat;
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
// Collect total ProbeStats on num_iters iterations of the following algorithm:
|
|
1778
|
+
// 1. Create new table
|
|
1779
|
+
// 2. Select 10% of keys and insert 10 elements key * 17 + j * 13
|
|
1780
|
+
// 3. Collect ProbeStats from final table
|
|
1781
|
+
ProbeStats CollectProbeStatsOnLinearlyTransformedKeys(
|
|
1782
|
+
const std::vector<int64_t>& keys, size_t num_iters) {
|
|
1783
|
+
ProbeStats stats;
|
|
1784
|
+
|
|
1785
|
+
absl::InsecureBitGen rng;
|
|
1786
|
+
auto linear_transform = [](size_t x, size_t y) { return x * 17 + y * 13; };
|
|
1787
|
+
std::uniform_int_distribution<size_t> dist(0, keys.size() - 1);
|
|
1788
|
+
while (num_iters--) {
|
|
1789
|
+
IntTable t1;
|
|
1790
|
+
size_t num_keys = keys.size() / 10;
|
|
1791
|
+
size_t start = dist(rng);
|
|
1792
|
+
for (size_t i = 0; i != num_keys; ++i) {
|
|
1793
|
+
for (size_t j = 0; j != 10; ++j) {
|
|
1794
|
+
t1.emplace(linear_transform(keys[(i + start) % keys.size()], j));
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
auto probe_histogram = GetHashtableDebugNumProbesHistogram(t1);
|
|
1799
|
+
stats.all_probes_histogram.resize(
|
|
1800
|
+
std::max(stats.all_probes_histogram.size(), probe_histogram.size()));
|
|
1801
|
+
std::transform(probe_histogram.begin(), probe_histogram.end(),
|
|
1802
|
+
stats.all_probes_histogram.begin(),
|
|
1803
|
+
stats.all_probes_histogram.begin(), std::plus<size_t>());
|
|
1804
|
+
|
|
1805
|
+
size_t total_probe_seq_length = 0;
|
|
1806
|
+
for (size_t i = 0; i < probe_histogram.size(); ++i) {
|
|
1807
|
+
total_probe_seq_length += i * probe_histogram[i];
|
|
1808
|
+
}
|
|
1809
|
+
stats.single_table_ratios.push_back(total_probe_seq_length * 1.0 /
|
|
1810
|
+
t1.size());
|
|
1811
|
+
t1.erase(t1.begin(), t1.end());
|
|
1812
|
+
}
|
|
1813
|
+
return stats;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
ExpectedStats LinearTransformExpectedStats() {
|
|
1817
|
+
constexpr bool kRandomizesInserts =
|
|
1818
|
+
#ifdef NDEBUG
|
|
1819
|
+
false;
|
|
1820
|
+
#else // NDEBUG
|
|
1821
|
+
true;
|
|
1822
|
+
#endif // NDEBUG
|
|
1823
|
+
|
|
1824
|
+
// The effective load factor is larger in non-opt mode because we insert
|
|
1825
|
+
// elements out of order.
|
|
1826
|
+
switch (container_internal::Group::kWidth) {
|
|
1827
|
+
case 8:
|
|
1828
|
+
if (kRandomizesInserts) {
|
|
1829
|
+
return {0.1,
|
|
1830
|
+
0.5,
|
|
1831
|
+
{{0.95, 0.3}},
|
|
1832
|
+
{{0.95, 0}, {0.99, 1}, {0.999, 8}, {0.9999, 15}}};
|
|
1833
|
+
} else {
|
|
1834
|
+
return {0.4,
|
|
1835
|
+
0.6,
|
|
1836
|
+
{{0.95, 0.5}},
|
|
1837
|
+
{{0.95, 1}, {0.99, 14}, {0.999, 23}, {0.9999, 26}}};
|
|
1838
|
+
}
|
|
1839
|
+
case 16:
|
|
1840
|
+
if (kRandomizesInserts) {
|
|
1841
|
+
return {0.1,
|
|
1842
|
+
0.4,
|
|
1843
|
+
{{0.95, 0.3}},
|
|
1844
|
+
{{0.95, 1}, {0.99, 2}, {0.999, 9}, {0.9999, 15}}};
|
|
1845
|
+
} else {
|
|
1846
|
+
return {0.05,
|
|
1847
|
+
0.2,
|
|
1848
|
+
{{0.95, 0.1}},
|
|
1849
|
+
{{0.95, 0}, {0.99, 1}, {0.999, 6}, {0.9999, 10}}};
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
LOG(FATAL) << "Unknown Group width";
|
|
1853
|
+
return {};
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
// TODO(b/80415403): Figure out why this test is so flaky.
|
|
1857
|
+
TEST(Table, DISABLED_EnsureNonQuadraticTopNLinearTransformByProbeSeqLength) {
|
|
1858
|
+
ProbeStatsPerSize stats;
|
|
1859
|
+
std::vector<size_t> sizes = {Group::kWidth << 5, Group::kWidth << 10};
|
|
1860
|
+
for (size_t size : sizes) {
|
|
1861
|
+
stats[size] = CollectProbeStatsOnLinearlyTransformedKeys(
|
|
1862
|
+
CollectBadMergeKeys(size), 300);
|
|
1863
|
+
}
|
|
1864
|
+
auto expected = LinearTransformExpectedStats();
|
|
1865
|
+
for (size_t size : sizes) {
|
|
1866
|
+
auto& stat = stats[size];
|
|
1867
|
+
VerifyStats(size, expected, stat);
|
|
1868
|
+
LOG(INFO) << size << " " << stat;
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
TEST(Table, EraseCollision) {
|
|
1873
|
+
BadTable t;
|
|
1874
|
+
|
|
1875
|
+
// 1 2 3
|
|
1876
|
+
t.emplace(1);
|
|
1877
|
+
t.emplace(2);
|
|
1878
|
+
t.emplace(3);
|
|
1879
|
+
EXPECT_THAT(*t.find(1), 1);
|
|
1880
|
+
EXPECT_THAT(*t.find(2), 2);
|
|
1881
|
+
EXPECT_THAT(*t.find(3), 3);
|
|
1882
|
+
EXPECT_EQ(3, t.size());
|
|
1883
|
+
|
|
1884
|
+
// 1 DELETED 3
|
|
1885
|
+
t.erase(t.find(2));
|
|
1886
|
+
EXPECT_THAT(*t.find(1), 1);
|
|
1887
|
+
EXPECT_TRUE(t.find(2) == t.end());
|
|
1888
|
+
EXPECT_THAT(*t.find(3), 3);
|
|
1889
|
+
EXPECT_EQ(2, t.size());
|
|
1890
|
+
|
|
1891
|
+
// DELETED DELETED 3
|
|
1892
|
+
t.erase(t.find(1));
|
|
1893
|
+
EXPECT_TRUE(t.find(1) == t.end());
|
|
1894
|
+
EXPECT_TRUE(t.find(2) == t.end());
|
|
1895
|
+
EXPECT_THAT(*t.find(3), 3);
|
|
1896
|
+
EXPECT_EQ(1, t.size());
|
|
1897
|
+
|
|
1898
|
+
// DELETED DELETED DELETED
|
|
1899
|
+
t.erase(t.find(3));
|
|
1900
|
+
EXPECT_TRUE(t.find(1) == t.end());
|
|
1901
|
+
EXPECT_TRUE(t.find(2) == t.end());
|
|
1902
|
+
EXPECT_TRUE(t.find(3) == t.end());
|
|
1903
|
+
EXPECT_EQ(0, t.size());
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
TEST(Table, EraseInsertProbing) {
|
|
1907
|
+
BadTable t(100);
|
|
1908
|
+
|
|
1909
|
+
// 1 2 3 4
|
|
1910
|
+
t.emplace(1);
|
|
1911
|
+
t.emplace(2);
|
|
1912
|
+
t.emplace(3);
|
|
1913
|
+
t.emplace(4);
|
|
1914
|
+
|
|
1915
|
+
// 1 DELETED 3 DELETED
|
|
1916
|
+
t.erase(t.find(2));
|
|
1917
|
+
t.erase(t.find(4));
|
|
1918
|
+
|
|
1919
|
+
// 1 10 3 11 12
|
|
1920
|
+
t.emplace(10);
|
|
1921
|
+
t.emplace(11);
|
|
1922
|
+
t.emplace(12);
|
|
1923
|
+
|
|
1924
|
+
EXPECT_EQ(5, t.size());
|
|
1925
|
+
EXPECT_THAT(t, UnorderedElementsAre(1, 10, 3, 11, 12));
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
TEST(Table, GrowthInfoDeletedBit) {
|
|
1929
|
+
BadTable t;
|
|
1930
|
+
int64_t init_count = static_cast<int64_t>(
|
|
1931
|
+
CapacityToGrowth(NormalizeCapacity(Group::kWidth + 1)));
|
|
1932
|
+
for (int64_t i = 0; i < init_count; ++i) {
|
|
1933
|
+
t.insert(i);
|
|
1934
|
+
}
|
|
1935
|
+
EXPECT_TRUE(
|
|
1936
|
+
RawHashSetTestOnlyAccess::GetCommon(t).growth_info().HasNoDeleted());
|
|
1937
|
+
t.erase(0);
|
|
1938
|
+
EXPECT_EQ(RawHashSetTestOnlyAccess::CountTombstones(t), 1);
|
|
1939
|
+
EXPECT_FALSE(
|
|
1940
|
+
RawHashSetTestOnlyAccess::GetCommon(t).growth_info().HasNoDeleted());
|
|
1941
|
+
t.rehash(0);
|
|
1942
|
+
EXPECT_EQ(RawHashSetTestOnlyAccess::CountTombstones(t), 0);
|
|
1943
|
+
EXPECT_TRUE(
|
|
1944
|
+
RawHashSetTestOnlyAccess::GetCommon(t).growth_info().HasNoDeleted());
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
TYPED_TEST(SooTest, Clear) {
|
|
1948
|
+
TypeParam t;
|
|
1949
|
+
EXPECT_TRUE(t.find(0) == t.end());
|
|
1950
|
+
t.clear();
|
|
1951
|
+
EXPECT_TRUE(t.find(0) == t.end());
|
|
1952
|
+
auto res = t.emplace(0);
|
|
1953
|
+
EXPECT_TRUE(res.second);
|
|
1954
|
+
EXPECT_EQ(1, t.size());
|
|
1955
|
+
t.clear();
|
|
1956
|
+
EXPECT_EQ(0, t.size());
|
|
1957
|
+
EXPECT_TRUE(t.find(0) == t.end());
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
TYPED_TEST(SooTest, Swap) {
|
|
1961
|
+
TypeParam t;
|
|
1962
|
+
EXPECT_TRUE(t.find(0) == t.end());
|
|
1963
|
+
auto res = t.emplace(0);
|
|
1964
|
+
EXPECT_TRUE(res.second);
|
|
1965
|
+
EXPECT_EQ(1, t.size());
|
|
1966
|
+
TypeParam u;
|
|
1967
|
+
t.swap(u);
|
|
1968
|
+
EXPECT_EQ(0, t.size());
|
|
1969
|
+
EXPECT_EQ(1, u.size());
|
|
1970
|
+
EXPECT_TRUE(t.find(0) == t.end());
|
|
1971
|
+
EXPECT_THAT(*u.find(0), 0);
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
TYPED_TEST(SooTest, Rehash) {
|
|
1975
|
+
TypeParam t;
|
|
1976
|
+
EXPECT_TRUE(t.find(0) == t.end());
|
|
1977
|
+
t.emplace(0);
|
|
1978
|
+
t.emplace(1);
|
|
1979
|
+
EXPECT_EQ(2, t.size());
|
|
1980
|
+
t.rehash(128);
|
|
1981
|
+
EXPECT_EQ(2, t.size());
|
|
1982
|
+
EXPECT_THAT(*t.find(0), 0);
|
|
1983
|
+
EXPECT_THAT(*t.find(1), 1);
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
TYPED_TEST(SooTest, RehashDoesNotRehashWhenNotNecessary) {
|
|
1987
|
+
TypeParam t;
|
|
1988
|
+
t.emplace(0);
|
|
1989
|
+
t.emplace(1);
|
|
1990
|
+
auto* p = &*t.find(0);
|
|
1991
|
+
t.rehash(1);
|
|
1992
|
+
EXPECT_EQ(p, &*t.find(0));
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
// Following two tests use non-SOO table because they test for 0 capacity.
|
|
1996
|
+
TEST(Table, RehashZeroDoesNotAllocateOnEmptyTable) {
|
|
1997
|
+
NonSooIntTable t;
|
|
1998
|
+
t.rehash(0);
|
|
1999
|
+
EXPECT_EQ(0, t.bucket_count());
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
TEST(Table, RehashZeroDeallocatesEmptyTable) {
|
|
2003
|
+
NonSooIntTable t;
|
|
2004
|
+
t.emplace(0);
|
|
2005
|
+
t.clear();
|
|
2006
|
+
EXPECT_NE(0, t.bucket_count());
|
|
2007
|
+
t.rehash(0);
|
|
2008
|
+
EXPECT_EQ(0, t.bucket_count());
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
TYPED_TEST(SooTest, RehashZeroForcesRehash) {
|
|
2012
|
+
TypeParam t;
|
|
2013
|
+
t.emplace(0);
|
|
2014
|
+
t.emplace(1);
|
|
2015
|
+
auto* p = &*t.find(0);
|
|
2016
|
+
t.rehash(0);
|
|
2017
|
+
EXPECT_NE(p, &*t.find(0));
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
TEST(Table, ConstructFromInitList) {
|
|
2021
|
+
using P = std::pair<std::string, std::string>;
|
|
2022
|
+
struct Q {
|
|
2023
|
+
operator P() const { return {}; } // NOLINT
|
|
2024
|
+
};
|
|
2025
|
+
StringTable t = {P(), Q(), {}, {{}, {}}};
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
TYPED_TEST(SooTest, CopyConstruct) {
|
|
2029
|
+
TypeParam t;
|
|
2030
|
+
t.emplace(0);
|
|
2031
|
+
EXPECT_EQ(1, t.size());
|
|
2032
|
+
{
|
|
2033
|
+
TypeParam u(t);
|
|
2034
|
+
EXPECT_EQ(1, u.size());
|
|
2035
|
+
EXPECT_THAT(*u.find(0), 0);
|
|
2036
|
+
}
|
|
2037
|
+
{
|
|
2038
|
+
TypeParam u{t};
|
|
2039
|
+
EXPECT_EQ(1, u.size());
|
|
2040
|
+
EXPECT_THAT(*u.find(0), 0);
|
|
2041
|
+
}
|
|
2042
|
+
{
|
|
2043
|
+
TypeParam u = t;
|
|
2044
|
+
EXPECT_EQ(1, u.size());
|
|
2045
|
+
EXPECT_THAT(*u.find(0), 0);
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
TYPED_TEST(SooTest, CopyAssignment) {
|
|
2050
|
+
std::vector<size_t> sizes = {0, 1, 7, 25};
|
|
2051
|
+
for (size_t source_size : sizes) {
|
|
2052
|
+
for (size_t target_size : sizes) {
|
|
2053
|
+
SCOPED_TRACE(absl::StrCat("source_size: ", source_size,
|
|
2054
|
+
" target_size: ", target_size));
|
|
2055
|
+
TypeParam source;
|
|
2056
|
+
std::vector<int> source_elements;
|
|
2057
|
+
for (size_t i = 0; i < source_size; ++i) {
|
|
2058
|
+
source.emplace(static_cast<int>(i) * 2);
|
|
2059
|
+
source_elements.push_back(static_cast<int>(i) * 2);
|
|
2060
|
+
}
|
|
2061
|
+
TypeParam target;
|
|
2062
|
+
for (size_t i = 0; i < target_size; ++i) {
|
|
2063
|
+
target.emplace(static_cast<int>(i) * 3);
|
|
2064
|
+
}
|
|
2065
|
+
target = source;
|
|
2066
|
+
ASSERT_EQ(target.size(), source_size);
|
|
2067
|
+
ASSERT_THAT(target, UnorderedElementsAreArray(source_elements));
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
TYPED_TEST(SooTest, CopyConstructWithSampling) {
|
|
2073
|
+
SetSamplingRateTo1Percent();
|
|
2074
|
+
for (int i = 0; i < 10000; ++i) {
|
|
2075
|
+
TypeParam t;
|
|
2076
|
+
t.emplace(0);
|
|
2077
|
+
EXPECT_EQ(1, t.size());
|
|
2078
|
+
{
|
|
2079
|
+
TypeParam u(t);
|
|
2080
|
+
EXPECT_EQ(1, u.size());
|
|
2081
|
+
EXPECT_THAT(*u.find(0), 0);
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
TYPED_TEST(SooTest, CopyDifferentSizes) {
|
|
2087
|
+
TypeParam t;
|
|
2088
|
+
|
|
2089
|
+
for (int i = 0; i < 100; ++i) {
|
|
2090
|
+
t.emplace(i);
|
|
2091
|
+
TypeParam c = t;
|
|
2092
|
+
for (int j = 0; j <= i; ++j) {
|
|
2093
|
+
ASSERT_TRUE(c.find(j) != c.end()) << "i=" << i << " j=" << j;
|
|
2094
|
+
}
|
|
2095
|
+
// Testing find miss to verify that table is not full.
|
|
2096
|
+
ASSERT_TRUE(c.find(-1) == c.end());
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
TYPED_TEST(SooTest, CopyDifferentCapacities) {
|
|
2101
|
+
for (int cap = 1; cap < 100; cap = cap * 2 + 1) {
|
|
2102
|
+
TypeParam t;
|
|
2103
|
+
t.reserve(static_cast<size_t>(cap));
|
|
2104
|
+
for (int i = 0; i <= cap; ++i) {
|
|
2105
|
+
t.emplace(i);
|
|
2106
|
+
if (i != cap && i % 5 != 0) {
|
|
2107
|
+
continue;
|
|
2108
|
+
}
|
|
2109
|
+
TypeParam c = t;
|
|
2110
|
+
for (int j = 0; j <= i; ++j) {
|
|
2111
|
+
ASSERT_TRUE(c.find(j) != c.end())
|
|
2112
|
+
<< "cap=" << cap << " i=" << i << " j=" << j;
|
|
2113
|
+
}
|
|
2114
|
+
// Testing find miss to verify that table is not full.
|
|
2115
|
+
ASSERT_TRUE(c.find(-1) == c.end());
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
TEST(Table, CopyConstructWithAlloc) {
|
|
2121
|
+
StringTable t;
|
|
2122
|
+
t.emplace("a", "b");
|
|
2123
|
+
EXPECT_EQ(1, t.size());
|
|
2124
|
+
StringTable u(t, Alloc<std::pair<std::string, std::string>>());
|
|
2125
|
+
EXPECT_EQ(1, u.size());
|
|
2126
|
+
EXPECT_THAT(*u.find("a"), Pair("a", "b"));
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
struct ExplicitAllocIntTable
|
|
2130
|
+
: raw_hash_set<IntPolicy, hash_default_hash<int64_t>,
|
|
2131
|
+
std::equal_to<int64_t>, Alloc<int64_t>> {
|
|
2132
|
+
ExplicitAllocIntTable() = default;
|
|
2133
|
+
};
|
|
2134
|
+
|
|
2135
|
+
TEST(Table, AllocWithExplicitCtor) {
|
|
2136
|
+
ExplicitAllocIntTable t;
|
|
2137
|
+
EXPECT_EQ(0, t.size());
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
TEST(Table, MoveConstruct) {
|
|
2141
|
+
{
|
|
2142
|
+
StringTable t;
|
|
2143
|
+
t.emplace("a", "b");
|
|
2144
|
+
EXPECT_EQ(1, t.size());
|
|
2145
|
+
|
|
2146
|
+
StringTable u(std::move(t));
|
|
2147
|
+
EXPECT_EQ(1, u.size());
|
|
2148
|
+
EXPECT_THAT(*u.find("a"), Pair("a", "b"));
|
|
2149
|
+
}
|
|
2150
|
+
{
|
|
2151
|
+
StringTable t;
|
|
2152
|
+
t.emplace("a", "b");
|
|
2153
|
+
EXPECT_EQ(1, t.size());
|
|
2154
|
+
|
|
2155
|
+
StringTable u{std::move(t)};
|
|
2156
|
+
EXPECT_EQ(1, u.size());
|
|
2157
|
+
EXPECT_THAT(*u.find("a"), Pair("a", "b"));
|
|
2158
|
+
}
|
|
2159
|
+
{
|
|
2160
|
+
StringTable t;
|
|
2161
|
+
t.emplace("a", "b");
|
|
2162
|
+
EXPECT_EQ(1, t.size());
|
|
2163
|
+
|
|
2164
|
+
StringTable u = std::move(t);
|
|
2165
|
+
EXPECT_EQ(1, u.size());
|
|
2166
|
+
EXPECT_THAT(*u.find("a"), Pair("a", "b"));
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
TEST(Table, MoveConstructWithAlloc) {
|
|
2171
|
+
StringTable t;
|
|
2172
|
+
t.emplace("a", "b");
|
|
2173
|
+
EXPECT_EQ(1, t.size());
|
|
2174
|
+
StringTable u(std::move(t), Alloc<std::pair<std::string, std::string>>());
|
|
2175
|
+
EXPECT_EQ(1, u.size());
|
|
2176
|
+
EXPECT_THAT(*u.find("a"), Pair("a", "b"));
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
TEST(Table, CopyAssign) {
|
|
2180
|
+
StringTable t;
|
|
2181
|
+
t.emplace("a", "b");
|
|
2182
|
+
EXPECT_EQ(1, t.size());
|
|
2183
|
+
StringTable u;
|
|
2184
|
+
u = t;
|
|
2185
|
+
EXPECT_EQ(1, u.size());
|
|
2186
|
+
EXPECT_THAT(*u.find("a"), Pair("a", "b"));
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
TEST(Table, CopySelfAssign) {
|
|
2190
|
+
StringTable t;
|
|
2191
|
+
t.emplace("a", "b");
|
|
2192
|
+
EXPECT_EQ(1, t.size());
|
|
2193
|
+
t = *&t;
|
|
2194
|
+
EXPECT_EQ(1, t.size());
|
|
2195
|
+
EXPECT_THAT(*t.find("a"), Pair("a", "b"));
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
TEST(Table, MoveAssign) {
|
|
2199
|
+
StringTable t;
|
|
2200
|
+
t.emplace("a", "b");
|
|
2201
|
+
EXPECT_EQ(1, t.size());
|
|
2202
|
+
StringTable u;
|
|
2203
|
+
u = std::move(t);
|
|
2204
|
+
EXPECT_EQ(1, u.size());
|
|
2205
|
+
EXPECT_THAT(*u.find("a"), Pair("a", "b"));
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
TEST(Table, MoveSelfAssign) {
|
|
2209
|
+
StringTable t;
|
|
2210
|
+
t.emplace("a", "b");
|
|
2211
|
+
EXPECT_EQ(1, t.size());
|
|
2212
|
+
t = std::move(*&t);
|
|
2213
|
+
if (SwisstableGenerationsEnabled()) {
|
|
2214
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
2215
|
+
EXPECT_DEATH_IF_SUPPORTED(t.contains("a"), "self-move-assigned");
|
|
2216
|
+
}
|
|
2217
|
+
// As long as we don't crash, it's fine.
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
TEST(Table, Equality) {
|
|
2221
|
+
StringTable t;
|
|
2222
|
+
std::vector<std::pair<std::string, std::string>> v = {{"a", "b"},
|
|
2223
|
+
{"aa", "bb"}};
|
|
2224
|
+
t.insert(std::begin(v), std::end(v));
|
|
2225
|
+
StringTable u = t;
|
|
2226
|
+
EXPECT_EQ(u, t);
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
TEST(Table, Equality2) {
|
|
2230
|
+
StringTable t;
|
|
2231
|
+
std::vector<std::pair<std::string, std::string>> v1 = {{"a", "b"},
|
|
2232
|
+
{"aa", "bb"}};
|
|
2233
|
+
t.insert(std::begin(v1), std::end(v1));
|
|
2234
|
+
StringTable u;
|
|
2235
|
+
std::vector<std::pair<std::string, std::string>> v2 = {{"a", "a"},
|
|
2236
|
+
{"aa", "aa"}};
|
|
2237
|
+
u.insert(std::begin(v2), std::end(v2));
|
|
2238
|
+
EXPECT_NE(u, t);
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
TEST(Table, Equality3) {
|
|
2242
|
+
StringTable t;
|
|
2243
|
+
std::vector<std::pair<std::string, std::string>> v1 = {{"b", "b"},
|
|
2244
|
+
{"bb", "bb"}};
|
|
2245
|
+
t.insert(std::begin(v1), std::end(v1));
|
|
2246
|
+
StringTable u;
|
|
2247
|
+
std::vector<std::pair<std::string, std::string>> v2 = {{"a", "a"},
|
|
2248
|
+
{"aa", "aa"}};
|
|
2249
|
+
u.insert(std::begin(v2), std::end(v2));
|
|
2250
|
+
EXPECT_NE(u, t);
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
TYPED_TEST(SooTest, NumDeletedRegression) {
|
|
2254
|
+
TypeParam t;
|
|
2255
|
+
t.emplace(0);
|
|
2256
|
+
t.erase(t.find(0));
|
|
2257
|
+
// construct over a deleted slot.
|
|
2258
|
+
t.emplace(0);
|
|
2259
|
+
t.clear();
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
TYPED_TEST(SooTest, FindFullDeletedRegression) {
|
|
2263
|
+
TypeParam t;
|
|
2264
|
+
for (int i = 0; i < 1000; ++i) {
|
|
2265
|
+
t.emplace(i);
|
|
2266
|
+
t.erase(t.find(i));
|
|
2267
|
+
}
|
|
2268
|
+
EXPECT_EQ(0, t.size());
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
TYPED_TEST(SooTest, ReplacingDeletedSlotDoesNotRehash) {
|
|
2272
|
+
// We need to disable hashtablez to avoid issues related to SOO and sampling.
|
|
2273
|
+
DisableSampling();
|
|
2274
|
+
|
|
2275
|
+
size_t n;
|
|
2276
|
+
{
|
|
2277
|
+
// Compute n such that n is the maximum number of elements before rehash.
|
|
2278
|
+
TypeParam t;
|
|
2279
|
+
t.emplace(0);
|
|
2280
|
+
size_t c = t.bucket_count();
|
|
2281
|
+
for (n = 1; c == t.bucket_count(); ++n) t.emplace(n);
|
|
2282
|
+
--n;
|
|
2283
|
+
}
|
|
2284
|
+
TypeParam t;
|
|
2285
|
+
t.rehash(n);
|
|
2286
|
+
const size_t c = t.bucket_count();
|
|
2287
|
+
for (size_t i = 0; i != n; ++i) t.emplace(i);
|
|
2288
|
+
EXPECT_EQ(c, t.bucket_count()) << "rehashing threshold = " << n;
|
|
2289
|
+
t.erase(0);
|
|
2290
|
+
t.emplace(0);
|
|
2291
|
+
EXPECT_EQ(c, t.bucket_count()) << "rehashing threshold = " << n;
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
TEST(Table, NoThrowMoveConstruct) {
|
|
2295
|
+
ASSERT_TRUE(
|
|
2296
|
+
std::is_nothrow_copy_constructible<absl::Hash<absl::string_view>>::value);
|
|
2297
|
+
ASSERT_TRUE(std::is_nothrow_copy_constructible<
|
|
2298
|
+
std::equal_to<absl::string_view>>::value);
|
|
2299
|
+
ASSERT_TRUE(std::is_nothrow_copy_constructible<std::allocator<int>>::value);
|
|
2300
|
+
EXPECT_TRUE(std::is_nothrow_move_constructible<StringTable>::value);
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
TEST(Table, NoThrowMoveAssign) {
|
|
2304
|
+
ASSERT_TRUE(
|
|
2305
|
+
std::is_nothrow_move_assignable<absl::Hash<absl::string_view>>::value);
|
|
2306
|
+
ASSERT_TRUE(
|
|
2307
|
+
std::is_nothrow_move_assignable<std::equal_to<absl::string_view>>::value);
|
|
2308
|
+
ASSERT_TRUE(std::is_nothrow_move_assignable<std::allocator<int>>::value);
|
|
2309
|
+
ASSERT_TRUE(
|
|
2310
|
+
absl::allocator_traits<std::allocator<int>>::is_always_equal::value);
|
|
2311
|
+
EXPECT_TRUE(std::is_nothrow_move_assignable<StringTable>::value);
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
TEST(Table, NoThrowSwappable) {
|
|
2315
|
+
ASSERT_TRUE(std::is_nothrow_swappable<absl::Hash<absl::string_view>>());
|
|
2316
|
+
ASSERT_TRUE(std::is_nothrow_swappable<std::equal_to<absl::string_view>>());
|
|
2317
|
+
ASSERT_TRUE(std::is_nothrow_swappable<std::allocator<int>>());
|
|
2318
|
+
EXPECT_TRUE(std::is_nothrow_swappable<StringTable>());
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
TEST(Table, HeterogeneousLookup) {
|
|
2322
|
+
struct Hash {
|
|
2323
|
+
size_t operator()(int64_t i) const { return i; }
|
|
2324
|
+
size_t operator()(double i) const {
|
|
2325
|
+
ADD_FAILURE();
|
|
2326
|
+
return i;
|
|
2327
|
+
}
|
|
2328
|
+
};
|
|
2329
|
+
struct Eq {
|
|
2330
|
+
bool operator()(int64_t a, int64_t b) const { return a == b; }
|
|
2331
|
+
bool operator()(double a, int64_t b) const {
|
|
2332
|
+
ADD_FAILURE();
|
|
2333
|
+
return a == b;
|
|
2334
|
+
}
|
|
2335
|
+
bool operator()(int64_t a, double b) const {
|
|
2336
|
+
ADD_FAILURE();
|
|
2337
|
+
return a == b;
|
|
2338
|
+
}
|
|
2339
|
+
bool operator()(double a, double b) const {
|
|
2340
|
+
ADD_FAILURE();
|
|
2341
|
+
return a == b;
|
|
2342
|
+
}
|
|
2343
|
+
};
|
|
2344
|
+
|
|
2345
|
+
struct THash {
|
|
2346
|
+
using is_transparent = void;
|
|
2347
|
+
size_t operator()(int64_t i) const { return i; }
|
|
2348
|
+
size_t operator()(double i) const { return i; }
|
|
2349
|
+
};
|
|
2350
|
+
struct TEq {
|
|
2351
|
+
using is_transparent = void;
|
|
2352
|
+
bool operator()(int64_t a, int64_t b) const { return a == b; }
|
|
2353
|
+
bool operator()(double a, int64_t b) const { return a == b; }
|
|
2354
|
+
bool operator()(int64_t a, double b) const { return a == b; }
|
|
2355
|
+
bool operator()(double a, double b) const { return a == b; }
|
|
2356
|
+
};
|
|
2357
|
+
|
|
2358
|
+
raw_hash_set<IntPolicy, Hash, Eq, Alloc<int64_t>> s{0, 1, 2};
|
|
2359
|
+
// It will convert to int64_t before the query.
|
|
2360
|
+
EXPECT_EQ(1, *s.find(double{1.1}));
|
|
2361
|
+
|
|
2362
|
+
raw_hash_set<IntPolicy, THash, TEq, Alloc<int64_t>> ts{0, 1, 2};
|
|
2363
|
+
// It will try to use the double, and fail to find the object.
|
|
2364
|
+
EXPECT_TRUE(ts.find(1.1) == ts.end());
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
template <class Table>
|
|
2368
|
+
using CallFind = decltype(std::declval<Table&>().find(17));
|
|
2369
|
+
|
|
2370
|
+
template <class Table>
|
|
2371
|
+
using CallErase = decltype(std::declval<Table&>().erase(17));
|
|
2372
|
+
|
|
2373
|
+
template <class Table>
|
|
2374
|
+
using CallExtract = decltype(std::declval<Table&>().extract(17));
|
|
2375
|
+
|
|
2376
|
+
template <class Table>
|
|
2377
|
+
using CallPrefetch = decltype(std::declval<Table&>().prefetch(17));
|
|
2378
|
+
|
|
2379
|
+
template <class Table>
|
|
2380
|
+
using CallCount = decltype(std::declval<Table&>().count(17));
|
|
2381
|
+
|
|
2382
|
+
template <template <typename> class C, class Table, class = void>
|
|
2383
|
+
struct VerifyResultOf : std::false_type {};
|
|
2384
|
+
|
|
2385
|
+
template <template <typename> class C, class Table>
|
|
2386
|
+
struct VerifyResultOf<C, Table, absl::void_t<C<Table>>> : std::true_type {};
|
|
2387
|
+
|
|
2388
|
+
TEST(Table, HeterogeneousLookupOverloads) {
|
|
2389
|
+
using NonTransparentTable =
|
|
2390
|
+
raw_hash_set<StringPolicy, absl::Hash<absl::string_view>,
|
|
2391
|
+
std::equal_to<absl::string_view>, std::allocator<int>>;
|
|
2392
|
+
|
|
2393
|
+
EXPECT_FALSE((VerifyResultOf<CallFind, NonTransparentTable>()));
|
|
2394
|
+
EXPECT_FALSE((VerifyResultOf<CallErase, NonTransparentTable>()));
|
|
2395
|
+
EXPECT_FALSE((VerifyResultOf<CallExtract, NonTransparentTable>()));
|
|
2396
|
+
EXPECT_FALSE((VerifyResultOf<CallPrefetch, NonTransparentTable>()));
|
|
2397
|
+
EXPECT_FALSE((VerifyResultOf<CallCount, NonTransparentTable>()));
|
|
2398
|
+
|
|
2399
|
+
using TransparentTable =
|
|
2400
|
+
raw_hash_set<StringPolicy, hash_default_hash<absl::string_view>,
|
|
2401
|
+
hash_default_eq<absl::string_view>, std::allocator<int>>;
|
|
2402
|
+
|
|
2403
|
+
EXPECT_TRUE((VerifyResultOf<CallFind, TransparentTable>()));
|
|
2404
|
+
EXPECT_TRUE((VerifyResultOf<CallErase, TransparentTable>()));
|
|
2405
|
+
EXPECT_TRUE((VerifyResultOf<CallExtract, TransparentTable>()));
|
|
2406
|
+
EXPECT_TRUE((VerifyResultOf<CallPrefetch, TransparentTable>()));
|
|
2407
|
+
EXPECT_TRUE((VerifyResultOf<CallCount, TransparentTable>()));
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
TEST(Iterator, IsDefaultConstructible) {
|
|
2411
|
+
StringTable::iterator i;
|
|
2412
|
+
EXPECT_TRUE(i == StringTable::iterator());
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
TEST(ConstIterator, IsDefaultConstructible) {
|
|
2416
|
+
StringTable::const_iterator i;
|
|
2417
|
+
EXPECT_TRUE(i == StringTable::const_iterator());
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
TEST(Iterator, ConvertsToConstIterator) {
|
|
2421
|
+
StringTable::iterator i;
|
|
2422
|
+
EXPECT_TRUE(i == StringTable::const_iterator());
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
TEST(Iterator, Iterates) {
|
|
2426
|
+
IntTable t;
|
|
2427
|
+
for (size_t i = 3; i != 6; ++i) EXPECT_TRUE(t.emplace(i).second);
|
|
2428
|
+
EXPECT_THAT(t, UnorderedElementsAre(3, 4, 5));
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
TEST(Table, Merge) {
|
|
2432
|
+
StringTable t1, t2;
|
|
2433
|
+
t1.emplace("0", "-0");
|
|
2434
|
+
t1.emplace("1", "-1");
|
|
2435
|
+
t2.emplace("0", "~0");
|
|
2436
|
+
t2.emplace("2", "~2");
|
|
2437
|
+
|
|
2438
|
+
EXPECT_THAT(t1, UnorderedElementsAre(Pair("0", "-0"), Pair("1", "-1")));
|
|
2439
|
+
EXPECT_THAT(t2, UnorderedElementsAre(Pair("0", "~0"), Pair("2", "~2")));
|
|
2440
|
+
|
|
2441
|
+
t1.merge(t2);
|
|
2442
|
+
EXPECT_THAT(t1, UnorderedElementsAre(Pair("0", "-0"), Pair("1", "-1"),
|
|
2443
|
+
Pair("2", "~2")));
|
|
2444
|
+
EXPECT_THAT(t2, UnorderedElementsAre(Pair("0", "~0")));
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
TEST(Table, MergeSmall) {
|
|
2448
|
+
StringTable t1, t2;
|
|
2449
|
+
t1.emplace("1", "1");
|
|
2450
|
+
t2.emplace("2", "2");
|
|
2451
|
+
|
|
2452
|
+
EXPECT_THAT(t1, UnorderedElementsAre(Pair("1", "1")));
|
|
2453
|
+
EXPECT_THAT(t2, UnorderedElementsAre(Pair("2", "2")));
|
|
2454
|
+
|
|
2455
|
+
t2.merge(t1);
|
|
2456
|
+
EXPECT_EQ(t1.size(), 0);
|
|
2457
|
+
EXPECT_THAT(t2, UnorderedElementsAre(Pair("1", "1"), Pair("2", "2")));
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
TEST(Table, IteratorEmplaceConstructibleRequirement) {
|
|
2461
|
+
struct Value {
|
|
2462
|
+
explicit Value(absl::string_view view) : value(view) {}
|
|
2463
|
+
std::string value;
|
|
2464
|
+
|
|
2465
|
+
bool operator==(const Value& other) const { return value == other.value; }
|
|
2466
|
+
};
|
|
2467
|
+
struct H {
|
|
2468
|
+
size_t operator()(const Value& v) const {
|
|
2469
|
+
return absl::Hash<std::string>{}(v.value);
|
|
2470
|
+
}
|
|
2471
|
+
};
|
|
2472
|
+
|
|
2473
|
+
struct Table
|
|
2474
|
+
: InstantiateRawHashSet<ValuePolicy<Value>, H, std::equal_to<Value>,
|
|
2475
|
+
std::allocator<Value>>::type {
|
|
2476
|
+
using Base = typename Table::raw_hash_set;
|
|
2477
|
+
using Base::Base;
|
|
2478
|
+
};
|
|
2479
|
+
|
|
2480
|
+
std::string input[3]{"A", "B", "C"};
|
|
2481
|
+
|
|
2482
|
+
Table t(std::begin(input), std::end(input));
|
|
2483
|
+
EXPECT_THAT(t, UnorderedElementsAre(Value{"A"}, Value{"B"}, Value{"C"}));
|
|
2484
|
+
|
|
2485
|
+
input[0] = "D";
|
|
2486
|
+
input[1] = "E";
|
|
2487
|
+
input[2] = "F";
|
|
2488
|
+
t.insert(std::begin(input), std::end(input));
|
|
2489
|
+
EXPECT_THAT(t, UnorderedElementsAre(Value{"A"}, Value{"B"}, Value{"C"},
|
|
2490
|
+
Value{"D"}, Value{"E"}, Value{"F"}));
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
TEST(Nodes, EmptyNodeType) {
|
|
2494
|
+
using node_type = StringTable::node_type;
|
|
2495
|
+
node_type n;
|
|
2496
|
+
EXPECT_FALSE(n);
|
|
2497
|
+
EXPECT_TRUE(n.empty());
|
|
2498
|
+
|
|
2499
|
+
EXPECT_TRUE((std::is_same<node_type::allocator_type,
|
|
2500
|
+
StringTable::allocator_type>::value));
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
TEST(Nodes, ExtractInsert) {
|
|
2504
|
+
constexpr char k0[] = "Very long string zero.";
|
|
2505
|
+
constexpr char k1[] = "Very long string one.";
|
|
2506
|
+
constexpr char k2[] = "Very long string two.";
|
|
2507
|
+
StringTable t = {{k0, ""}, {k1, ""}, {k2, ""}};
|
|
2508
|
+
EXPECT_THAT(t,
|
|
2509
|
+
UnorderedElementsAre(Pair(k0, ""), Pair(k1, ""), Pair(k2, "")));
|
|
2510
|
+
|
|
2511
|
+
auto node = t.extract(k0);
|
|
2512
|
+
EXPECT_THAT(t, UnorderedElementsAre(Pair(k1, ""), Pair(k2, "")));
|
|
2513
|
+
EXPECT_TRUE(node);
|
|
2514
|
+
EXPECT_FALSE(node.empty());
|
|
2515
|
+
|
|
2516
|
+
StringTable t2;
|
|
2517
|
+
StringTable::insert_return_type res = t2.insert(std::move(node));
|
|
2518
|
+
EXPECT_TRUE(res.inserted);
|
|
2519
|
+
EXPECT_THAT(*res.position, Pair(k0, ""));
|
|
2520
|
+
EXPECT_FALSE(res.node);
|
|
2521
|
+
EXPECT_THAT(t2, UnorderedElementsAre(Pair(k0, "")));
|
|
2522
|
+
|
|
2523
|
+
// Not there.
|
|
2524
|
+
EXPECT_THAT(t, UnorderedElementsAre(Pair(k1, ""), Pair(k2, "")));
|
|
2525
|
+
node = t.extract("Not there!");
|
|
2526
|
+
EXPECT_THAT(t, UnorderedElementsAre(Pair(k1, ""), Pair(k2, "")));
|
|
2527
|
+
EXPECT_FALSE(node);
|
|
2528
|
+
|
|
2529
|
+
// Inserting nothing.
|
|
2530
|
+
res = t2.insert(std::move(node));
|
|
2531
|
+
EXPECT_FALSE(res.inserted);
|
|
2532
|
+
EXPECT_EQ(res.position, t2.end());
|
|
2533
|
+
EXPECT_FALSE(res.node);
|
|
2534
|
+
EXPECT_THAT(t2, UnorderedElementsAre(Pair(k0, "")));
|
|
2535
|
+
|
|
2536
|
+
t.emplace(k0, "1");
|
|
2537
|
+
node = t.extract(k0);
|
|
2538
|
+
|
|
2539
|
+
// Insert duplicate.
|
|
2540
|
+
res = t2.insert(std::move(node));
|
|
2541
|
+
EXPECT_FALSE(res.inserted);
|
|
2542
|
+
EXPECT_THAT(*res.position, Pair(k0, ""));
|
|
2543
|
+
EXPECT_TRUE(res.node);
|
|
2544
|
+
EXPECT_FALSE(node); // NOLINT(bugprone-use-after-move)
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
TEST(Nodes, ExtractInsertSmall) {
|
|
2548
|
+
constexpr char k0[] = "Very long string zero.";
|
|
2549
|
+
StringTable t = {{k0, ""}};
|
|
2550
|
+
EXPECT_THAT(t, UnorderedElementsAre(Pair(k0, "")));
|
|
2551
|
+
|
|
2552
|
+
auto node = t.extract(k0);
|
|
2553
|
+
EXPECT_EQ(t.size(), 0);
|
|
2554
|
+
EXPECT_TRUE(node);
|
|
2555
|
+
EXPECT_FALSE(node.empty());
|
|
2556
|
+
|
|
2557
|
+
StringTable t2;
|
|
2558
|
+
StringTable::insert_return_type res = t2.insert(std::move(node));
|
|
2559
|
+
EXPECT_TRUE(res.inserted);
|
|
2560
|
+
EXPECT_THAT(*res.position, Pair(k0, ""));
|
|
2561
|
+
EXPECT_FALSE(res.node);
|
|
2562
|
+
EXPECT_THAT(t2, UnorderedElementsAre(Pair(k0, "")));
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
TYPED_TEST(SooTest, HintInsert) {
|
|
2566
|
+
TypeParam t = {1, 2, 3};
|
|
2567
|
+
auto node = t.extract(1);
|
|
2568
|
+
EXPECT_THAT(t, UnorderedElementsAre(2, 3));
|
|
2569
|
+
auto it = t.insert(t.begin(), std::move(node));
|
|
2570
|
+
EXPECT_THAT(t, UnorderedElementsAre(1, 2, 3));
|
|
2571
|
+
EXPECT_EQ(*it, 1);
|
|
2572
|
+
EXPECT_FALSE(node); // NOLINT(bugprone-use-after-move)
|
|
2573
|
+
|
|
2574
|
+
node = t.extract(2);
|
|
2575
|
+
EXPECT_THAT(t, UnorderedElementsAre(1, 3));
|
|
2576
|
+
// reinsert 2 to make the next insert fail.
|
|
2577
|
+
t.insert(2);
|
|
2578
|
+
EXPECT_THAT(t, UnorderedElementsAre(1, 2, 3));
|
|
2579
|
+
it = t.insert(t.begin(), std::move(node));
|
|
2580
|
+
EXPECT_EQ(*it, 2);
|
|
2581
|
+
// The node was not emptied by the insert call.
|
|
2582
|
+
EXPECT_TRUE(node); // NOLINT(bugprone-use-after-move)
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
template <typename T>
|
|
2586
|
+
T MakeSimpleTable(size_t size, bool do_reserve) {
|
|
2587
|
+
T t;
|
|
2588
|
+
if (do_reserve) t.reserve(size);
|
|
2589
|
+
while (t.size() < size) t.insert(t.size());
|
|
2590
|
+
return t;
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
template <typename T>
|
|
2594
|
+
std::vector<int> OrderOfIteration(const T& t) {
|
|
2595
|
+
std::vector<int> res;
|
|
2596
|
+
for (auto i : t) res.push_back(static_cast<int>(i));
|
|
2597
|
+
return res;
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
// Generate irrelevant seeds to avoid being stuck in the same last bit
|
|
2601
|
+
// in seed.
|
|
2602
|
+
void GenerateIrrelevantSeeds(int cnt) {
|
|
2603
|
+
for (int i = cnt % 17; i > 0; --i) {
|
|
2604
|
+
HashtableSize::NextSeed();
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
// These IterationOrderChanges tests depend on non-deterministic behavior.
|
|
2609
|
+
// We are injecting non-determinism to the table.
|
|
2610
|
+
// We have to retry enough times to make sure that the seed changes in bits that
|
|
2611
|
+
// matter for the iteration order.
|
|
2612
|
+
TYPED_TEST(SooTest, IterationOrderChangesByInstance) {
|
|
2613
|
+
DisableSampling(); // We do not want test to pass only because of sampling.
|
|
2614
|
+
for (bool do_reserve : {false, true}) {
|
|
2615
|
+
for (size_t size : {2u, 6u, 12u, 20u}) {
|
|
2616
|
+
SCOPED_TRACE(absl::StrCat("size: ", size, " do_reserve: ", do_reserve));
|
|
2617
|
+
const auto reference_table = MakeSimpleTable<TypeParam>(size, do_reserve);
|
|
2618
|
+
const auto reference = OrderOfIteration(reference_table);
|
|
2619
|
+
|
|
2620
|
+
bool found_difference = false;
|
|
2621
|
+
for (int i = 0; !found_difference && i < 500; ++i) {
|
|
2622
|
+
auto new_table = MakeSimpleTable<TypeParam>(size, do_reserve);
|
|
2623
|
+
found_difference = OrderOfIteration(new_table) != reference;
|
|
2624
|
+
GenerateIrrelevantSeeds(i);
|
|
2625
|
+
}
|
|
2626
|
+
if (!found_difference) {
|
|
2627
|
+
FAIL() << "Iteration order remained the same across many attempts.";
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
TYPED_TEST(SooTest, IterationOrderChangesOnRehash) {
|
|
2634
|
+
DisableSampling(); // We do not want test to pass only because of sampling.
|
|
2635
|
+
|
|
2636
|
+
// We test different sizes with many small numbers, because small table
|
|
2637
|
+
// resize has a different codepath.
|
|
2638
|
+
// Note: iteration order for size() <= 1 is always the same.
|
|
2639
|
+
for (bool do_reserve : {false, true}) {
|
|
2640
|
+
for (size_t size : {2u, 3u, 6u, 7u, 12u, 15u, 20u, 50u}) {
|
|
2641
|
+
for (size_t rehash_size : {
|
|
2642
|
+
size_t{0}, // Force rehash is guaranteed.
|
|
2643
|
+
size * 10 // Rehash to the larger capacity is guaranteed.
|
|
2644
|
+
}) {
|
|
2645
|
+
SCOPED_TRACE(absl::StrCat("size: ", size, " rehash_size: ", rehash_size,
|
|
2646
|
+
" do_reserve: ", do_reserve));
|
|
2647
|
+
bool ok = false;
|
|
2648
|
+
auto t = MakeSimpleTable<TypeParam>(size, do_reserve);
|
|
2649
|
+
const size_t original_capacity = t.capacity();
|
|
2650
|
+
auto reference = OrderOfIteration(t);
|
|
2651
|
+
for (int i = 0; i < 500; ++i) {
|
|
2652
|
+
if (i > 0 && rehash_size != 0) {
|
|
2653
|
+
// Rehash back to original size.
|
|
2654
|
+
t.rehash(0);
|
|
2655
|
+
ASSERT_EQ(t.capacity(), original_capacity);
|
|
2656
|
+
reference = OrderOfIteration(t);
|
|
2657
|
+
}
|
|
2658
|
+
// Force rehash.
|
|
2659
|
+
t.rehash(rehash_size);
|
|
2660
|
+
auto trial = OrderOfIteration(t);
|
|
2661
|
+
if (trial != reference) {
|
|
2662
|
+
// We are done.
|
|
2663
|
+
ok = true;
|
|
2664
|
+
break;
|
|
2665
|
+
}
|
|
2666
|
+
GenerateIrrelevantSeeds(i);
|
|
2667
|
+
}
|
|
2668
|
+
EXPECT_TRUE(ok)
|
|
2669
|
+
<< "Iteration order remained the same across many attempts " << size
|
|
2670
|
+
<< "->" << rehash_size << ".";
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
// Verify that pointers are invalidated as soon as a second element is inserted.
|
|
2677
|
+
// This prevents dependency on pointer stability on small tables.
|
|
2678
|
+
TYPED_TEST(SooTest, UnstablePointers) {
|
|
2679
|
+
// We need to disable hashtablez to avoid issues related to SOO and sampling.
|
|
2680
|
+
DisableSampling();
|
|
2681
|
+
|
|
2682
|
+
TypeParam table;
|
|
2683
|
+
|
|
2684
|
+
const auto addr = [&](int i) {
|
|
2685
|
+
return reinterpret_cast<uintptr_t>(&*table.find(i));
|
|
2686
|
+
};
|
|
2687
|
+
|
|
2688
|
+
table.insert(0);
|
|
2689
|
+
const uintptr_t old_ptr = addr(0);
|
|
2690
|
+
|
|
2691
|
+
// This causes a rehash.
|
|
2692
|
+
table.insert(1);
|
|
2693
|
+
|
|
2694
|
+
EXPECT_NE(old_ptr, addr(0));
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
TEST(TableDeathTest, InvalidIteratorAsserts) {
|
|
2698
|
+
if (!IsAssertEnabled() && !SwisstableGenerationsEnabled())
|
|
2699
|
+
GTEST_SKIP() << "Assertions not enabled.";
|
|
2700
|
+
|
|
2701
|
+
NonSooIntTable t;
|
|
2702
|
+
// Extra simple "regexp" as regexp support is highly varied across platforms.
|
|
2703
|
+
EXPECT_DEATH_IF_SUPPORTED(++t.end(), "operator.* called on end.. iterator.");
|
|
2704
|
+
typename NonSooIntTable::iterator iter;
|
|
2705
|
+
EXPECT_DEATH_IF_SUPPORTED(
|
|
2706
|
+
++iter, "operator.* called on default-constructed iterator.");
|
|
2707
|
+
t.insert(0);
|
|
2708
|
+
t.insert(1);
|
|
2709
|
+
iter = t.begin();
|
|
2710
|
+
t.erase(iter);
|
|
2711
|
+
const char* const kErasedDeathMessage =
|
|
2712
|
+
SwisstableGenerationsEnabled()
|
|
2713
|
+
? "operator.* called on invalid iterator.*was likely erased"
|
|
2714
|
+
: "operator.* called on invalid iterator.*might have been "
|
|
2715
|
+
"erased.*config=asan";
|
|
2716
|
+
EXPECT_DEATH_IF_SUPPORTED(++iter, kErasedDeathMessage);
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
TEST(TableDeathTest, InvalidIteratorAssertsSoo) {
|
|
2720
|
+
if (!IsAssertEnabled() && !SwisstableGenerationsEnabled())
|
|
2721
|
+
GTEST_SKIP() << "Assertions not enabled.";
|
|
2722
|
+
|
|
2723
|
+
SooIntTable t;
|
|
2724
|
+
// Extra simple "regexp" as regexp support is highly varied across platforms.
|
|
2725
|
+
EXPECT_DEATH_IF_SUPPORTED(t.erase(t.end()),
|
|
2726
|
+
"erase.* called on end.. iterator.");
|
|
2727
|
+
typename SooIntTable::iterator iter;
|
|
2728
|
+
EXPECT_DEATH_IF_SUPPORTED(
|
|
2729
|
+
++iter, "operator.* called on default-constructed iterator.");
|
|
2730
|
+
|
|
2731
|
+
// We can't detect the erased iterator case as invalid in SOO mode because
|
|
2732
|
+
// the control is static constant.
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
// Invalid iterator use can trigger use-after-free in asan/hwasan,
|
|
2736
|
+
// use-of-uninitialized-value in msan, or invalidated iterator assertions.
|
|
2737
|
+
constexpr const char* kInvalidIteratorDeathMessage =
|
|
2738
|
+
"use-after-free|use-of-uninitialized-value|invalidated "
|
|
2739
|
+
"iterator|Invalid iterator|invalid iterator";
|
|
2740
|
+
|
|
2741
|
+
// MSVC doesn't support | in regex.
|
|
2742
|
+
#if defined(_MSC_VER)
|
|
2743
|
+
constexpr bool kMsvc = true;
|
|
2744
|
+
#else
|
|
2745
|
+
constexpr bool kMsvc = false;
|
|
2746
|
+
#endif
|
|
2747
|
+
|
|
2748
|
+
TYPED_TEST(SooTest, IteratorInvalidAssertsEqualityOperator) {
|
|
2749
|
+
if (!IsAssertEnabled() && !SwisstableGenerationsEnabled())
|
|
2750
|
+
GTEST_SKIP() << "Assertions not enabled.";
|
|
2751
|
+
|
|
2752
|
+
TypeParam t;
|
|
2753
|
+
t.insert(1);
|
|
2754
|
+
t.insert(2);
|
|
2755
|
+
t.insert(3);
|
|
2756
|
+
auto iter1 = t.begin();
|
|
2757
|
+
auto iter2 = std::next(iter1);
|
|
2758
|
+
ASSERT_NE(iter1, t.end());
|
|
2759
|
+
ASSERT_NE(iter2, t.end());
|
|
2760
|
+
t.erase(iter1);
|
|
2761
|
+
// Extra simple "regexp" as regexp support is highly varied across platforms.
|
|
2762
|
+
const char* const kErasedDeathMessage =
|
|
2763
|
+
SwisstableGenerationsEnabled()
|
|
2764
|
+
? "Invalid iterator comparison.*was likely erased"
|
|
2765
|
+
: "Invalid iterator comparison.*might have been erased.*config=asan";
|
|
2766
|
+
EXPECT_DEATH_IF_SUPPORTED(void(iter1 == iter2), kErasedDeathMessage);
|
|
2767
|
+
EXPECT_DEATH_IF_SUPPORTED(void(iter2 != iter1), kErasedDeathMessage);
|
|
2768
|
+
t.erase(iter2);
|
|
2769
|
+
EXPECT_DEATH_IF_SUPPORTED(void(iter1 == iter2), kErasedDeathMessage);
|
|
2770
|
+
|
|
2771
|
+
TypeParam t1, t2;
|
|
2772
|
+
t1.insert(0);
|
|
2773
|
+
t2.insert(0);
|
|
2774
|
+
iter1 = t1.begin();
|
|
2775
|
+
iter2 = t2.begin();
|
|
2776
|
+
const char* const kContainerDiffDeathMessage =
|
|
2777
|
+
SwisstableGenerationsEnabled()
|
|
2778
|
+
? "Invalid iterator comparison.*iterators from different.* hashtables"
|
|
2779
|
+
: "Invalid iterator comparison.*may be from different "
|
|
2780
|
+
".*containers.*config=asan";
|
|
2781
|
+
EXPECT_DEATH_IF_SUPPORTED(void(iter1 == iter2), kContainerDiffDeathMessage);
|
|
2782
|
+
EXPECT_DEATH_IF_SUPPORTED(void(iter2 == iter1), kContainerDiffDeathMessage);
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
TYPED_TEST(SooTest, IteratorInvalidAssertsEqualityOperatorRehash) {
|
|
2786
|
+
if (!IsAssertEnabled() && !SwisstableGenerationsEnabled())
|
|
2787
|
+
GTEST_SKIP() << "Assertions not enabled.";
|
|
2788
|
+
if (kMsvc) GTEST_SKIP() << "MSVC doesn't support | in regex.";
|
|
2789
|
+
#ifdef ABSL_HAVE_THREAD_SANITIZER
|
|
2790
|
+
GTEST_SKIP() << "ThreadSanitizer test runs fail on use-after-free even in "
|
|
2791
|
+
"EXPECT_DEATH.";
|
|
2792
|
+
#endif
|
|
2793
|
+
|
|
2794
|
+
TypeParam t;
|
|
2795
|
+
t.insert(0);
|
|
2796
|
+
auto iter = t.begin();
|
|
2797
|
+
|
|
2798
|
+
// Trigger a rehash in t.
|
|
2799
|
+
for (int i = 0; i < 10; ++i) t.insert(i);
|
|
2800
|
+
|
|
2801
|
+
const char* const kRehashedDeathMessage =
|
|
2802
|
+
SwisstableGenerationsEnabled()
|
|
2803
|
+
? kInvalidIteratorDeathMessage
|
|
2804
|
+
: "Invalid iterator comparison.*might have rehashed.*config=asan";
|
|
2805
|
+
EXPECT_DEATH_IF_SUPPORTED(void(iter == t.begin()), kRehashedDeathMessage);
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2808
|
+
#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
|
|
2809
|
+
template <typename T>
|
|
2810
|
+
class RawHashSamplerTest : public testing::Test {};
|
|
2811
|
+
|
|
2812
|
+
using RawHashSamplerTestTypes = ::testing::Types<
|
|
2813
|
+
// 32 bits to make sure that table is Soo for 32 bits platform as well.
|
|
2814
|
+
// 64 bits table is not SOO due to alignment.
|
|
2815
|
+
SooInt32Table,
|
|
2816
|
+
NonSooIntTable>;
|
|
2817
|
+
TYPED_TEST_SUITE(RawHashSamplerTest, RawHashSamplerTestTypes);
|
|
2818
|
+
|
|
2819
|
+
TYPED_TEST(RawHashSamplerTest, Sample) {
|
|
2820
|
+
constexpr bool soo_enabled = std::is_same<SooInt32Table, TypeParam>::value;
|
|
2821
|
+
// Enable the feature even if the prod default is off.
|
|
2822
|
+
SetSamplingRateTo1Percent();
|
|
2823
|
+
|
|
2824
|
+
ASSERT_EQ(TypeParam().capacity(), soo_enabled ? SooCapacity() : 0);
|
|
2825
|
+
|
|
2826
|
+
auto& sampler = GlobalHashtablezSampler();
|
|
2827
|
+
size_t start_size = 0;
|
|
2828
|
+
|
|
2829
|
+
// Reserve these utility tables, so that if they sampled, they'll be
|
|
2830
|
+
// preexisting.
|
|
2831
|
+
absl::flat_hash_set<const HashtablezInfo*> preexisting_info(10);
|
|
2832
|
+
absl::flat_hash_map<size_t, int> observed_checksums(10);
|
|
2833
|
+
absl::flat_hash_map<ssize_t, int> reservations(10);
|
|
2834
|
+
absl::flat_hash_map<std::pair<size_t, size_t>, int> hit_misses(10);
|
|
2835
|
+
|
|
2836
|
+
start_size += sampler.Iterate([&](const HashtablezInfo& info) {
|
|
2837
|
+
preexisting_info.insert(&info);
|
|
2838
|
+
++start_size;
|
|
2839
|
+
});
|
|
2840
|
+
|
|
2841
|
+
std::vector<TypeParam> tables;
|
|
2842
|
+
for (int i = 0; i < 1000000; ++i) {
|
|
2843
|
+
tables.emplace_back();
|
|
2844
|
+
|
|
2845
|
+
const bool do_reserve = (i % 10 > 5);
|
|
2846
|
+
const bool do_rehash = !do_reserve && (i % 10 > 0);
|
|
2847
|
+
const bool do_first_insert_hit = i % 2 == 0;
|
|
2848
|
+
const bool do_second_insert_hit = i % 4 == 0;
|
|
2849
|
+
|
|
2850
|
+
if (do_reserve) {
|
|
2851
|
+
// Don't reserve on all tables.
|
|
2852
|
+
tables.back().reserve(10 * (i % 10));
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
tables.back().insert(1);
|
|
2856
|
+
if (do_first_insert_hit) {
|
|
2857
|
+
tables.back().insert(1);
|
|
2858
|
+
tables.back().insert(1);
|
|
2859
|
+
}
|
|
2860
|
+
tables.back().insert(i % 5);
|
|
2861
|
+
if (do_second_insert_hit) {
|
|
2862
|
+
tables.back().insert(i % 5);
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
if (do_rehash) {
|
|
2866
|
+
// Rehash some other tables.
|
|
2867
|
+
tables.back().rehash(10 * (i % 10));
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
size_t end_size = 0;
|
|
2871
|
+
end_size += sampler.Iterate([&](const HashtablezInfo& info) {
|
|
2872
|
+
++end_size;
|
|
2873
|
+
if (preexisting_info.contains(&info)) return;
|
|
2874
|
+
reservations[info.max_reserve.load(std::memory_order_relaxed)]++;
|
|
2875
|
+
hit_misses[std::make_pair(
|
|
2876
|
+
info.num_insert_hits.load(std::memory_order_relaxed),
|
|
2877
|
+
info.size.load(std::memory_order_relaxed))]++;
|
|
2878
|
+
|
|
2879
|
+
EXPECT_EQ(info.inline_element_size, sizeof(typename TypeParam::value_type));
|
|
2880
|
+
EXPECT_EQ(info.key_size, sizeof(typename TypeParam::key_type));
|
|
2881
|
+
EXPECT_EQ(info.value_size, sizeof(typename TypeParam::value_type));
|
|
2882
|
+
|
|
2883
|
+
if (soo_enabled) {
|
|
2884
|
+
EXPECT_EQ(info.soo_capacity, SooCapacity());
|
|
2885
|
+
} else {
|
|
2886
|
+
EXPECT_EQ(info.soo_capacity, 0);
|
|
2887
|
+
}
|
|
2888
|
+
});
|
|
2889
|
+
|
|
2890
|
+
// Expect that we sampled at the requested sampling rate of ~1%.
|
|
2891
|
+
EXPECT_NEAR((end_size - start_size) / static_cast<double>(tables.size()),
|
|
2892
|
+
0.01, 0.005);
|
|
2893
|
+
|
|
2894
|
+
ASSERT_EQ(reservations.size(), 10);
|
|
2895
|
+
for (const auto& [reservation, count] : reservations) {
|
|
2896
|
+
EXPECT_GE(reservation, 0);
|
|
2897
|
+
EXPECT_LT(reservation, 100);
|
|
2898
|
+
|
|
2899
|
+
EXPECT_NEAR((100 * count) / static_cast<double>(tables.size()), 0.1, 0.05)
|
|
2900
|
+
<< reservation;
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
EXPECT_THAT(hit_misses, testing::SizeIs(6));
|
|
2904
|
+
const double sampled_tables = end_size - start_size;
|
|
2905
|
+
// i % 20: { 1, 11 }
|
|
2906
|
+
EXPECT_NEAR((hit_misses[{1, 1}] / sampled_tables), 0.10, 0.02);
|
|
2907
|
+
// i % 20: { 6 }
|
|
2908
|
+
EXPECT_NEAR((hit_misses[{3, 1}] / sampled_tables), 0.05, 0.02);
|
|
2909
|
+
// i % 20: { 0, 4, 8, 12 }
|
|
2910
|
+
EXPECT_NEAR((hit_misses[{3, 2}] / sampled_tables), 0.20, 0.02);
|
|
2911
|
+
// i % 20: { 2, 10, 14, 18 }
|
|
2912
|
+
EXPECT_NEAR((hit_misses[{2, 2}] / sampled_tables), 0.20, 0.02);
|
|
2913
|
+
// i % 20: { 16 }
|
|
2914
|
+
EXPECT_NEAR((hit_misses[{4, 1}] / sampled_tables), 0.05, 0.02);
|
|
2915
|
+
// i % 20: { 3, 5, 7, 9, 13, 15, 17, 19 }
|
|
2916
|
+
EXPECT_NEAR((hit_misses[{0, 2}] / sampled_tables), 0.40, 0.02);
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
std::vector<const HashtablezInfo*> SampleSooMutation(
|
|
2920
|
+
absl::FunctionRef<void(SooInt32Table&)> mutate_table) {
|
|
2921
|
+
// Enable the feature even if the prod default is off.
|
|
2922
|
+
SetSamplingRateTo1Percent();
|
|
2923
|
+
|
|
2924
|
+
auto& sampler = GlobalHashtablezSampler();
|
|
2925
|
+
int64_t start_size = 0;
|
|
2926
|
+
// Reserve the table, so that if it sampled, it'll be preexisting.
|
|
2927
|
+
absl::flat_hash_set<const HashtablezInfo*> preexisting_info(10);
|
|
2928
|
+
start_size += sampler.Iterate([&](const HashtablezInfo& info) {
|
|
2929
|
+
preexisting_info.insert(&info);
|
|
2930
|
+
++start_size;
|
|
2931
|
+
});
|
|
2932
|
+
|
|
2933
|
+
std::vector<SooInt32Table> tables;
|
|
2934
|
+
for (int i = 0; i < 1000000; ++i) {
|
|
2935
|
+
tables.emplace_back();
|
|
2936
|
+
mutate_table(tables.back());
|
|
2937
|
+
}
|
|
2938
|
+
int64_t end_size = 0;
|
|
2939
|
+
std::vector<const HashtablezInfo*> infos;
|
|
2940
|
+
end_size += sampler.Iterate([&](const HashtablezInfo& info) {
|
|
2941
|
+
++end_size;
|
|
2942
|
+
if (preexisting_info.contains(&info)) return;
|
|
2943
|
+
infos.push_back(&info);
|
|
2944
|
+
});
|
|
2945
|
+
|
|
2946
|
+
// Expect that we sampled at the requested sampling rate of ~1%.
|
|
2947
|
+
EXPECT_NEAR((end_size - start_size) / static_cast<double>(tables.size()),
|
|
2948
|
+
0.01, 0.005);
|
|
2949
|
+
return infos;
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2952
|
+
TEST(RawHashSamplerTest, SooTableInsertToEmpty) {
|
|
2953
|
+
if (SooInt32Table().capacity() != SooCapacity()) {
|
|
2954
|
+
CHECK_LT(sizeof(void*), 8) << "missing SOO coverage";
|
|
2955
|
+
GTEST_SKIP() << "not SOO on this platform";
|
|
2956
|
+
}
|
|
2957
|
+
std::vector<const HashtablezInfo*> infos =
|
|
2958
|
+
SampleSooMutation([](SooInt32Table& t) { t.insert(1); });
|
|
2959
|
+
|
|
2960
|
+
for (const HashtablezInfo* info : infos) {
|
|
2961
|
+
ASSERT_EQ(info->inline_element_size,
|
|
2962
|
+
sizeof(typename SooInt32Table::value_type));
|
|
2963
|
+
ASSERT_EQ(info->soo_capacity, SooCapacity());
|
|
2964
|
+
ASSERT_EQ(info->capacity, NextCapacity(SooCapacity()));
|
|
2965
|
+
ASSERT_EQ(info->size, 1);
|
|
2966
|
+
ASSERT_EQ(info->max_reserve, 0);
|
|
2967
|
+
ASSERT_EQ(info->num_erases, 0);
|
|
2968
|
+
ASSERT_EQ(info->max_probe_length, 0);
|
|
2969
|
+
ASSERT_EQ(info->total_probe_length, 0);
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2973
|
+
TEST(RawHashSamplerTest, SooTableReserveToEmpty) {
|
|
2974
|
+
if (SooInt32Table().capacity() != SooCapacity()) {
|
|
2975
|
+
CHECK_LT(sizeof(void*), 8) << "missing SOO coverage";
|
|
2976
|
+
GTEST_SKIP() << "not SOO on this platform";
|
|
2977
|
+
}
|
|
2978
|
+
std::vector<const HashtablezInfo*> infos =
|
|
2979
|
+
SampleSooMutation([](SooInt32Table& t) { t.reserve(100); });
|
|
2980
|
+
|
|
2981
|
+
for (const HashtablezInfo* info : infos) {
|
|
2982
|
+
ASSERT_EQ(info->inline_element_size,
|
|
2983
|
+
sizeof(typename SooInt32Table::value_type));
|
|
2984
|
+
ASSERT_EQ(info->soo_capacity, SooCapacity());
|
|
2985
|
+
ASSERT_GE(info->capacity, 100);
|
|
2986
|
+
ASSERT_EQ(info->size, 0);
|
|
2987
|
+
ASSERT_EQ(info->max_reserve, 100);
|
|
2988
|
+
ASSERT_EQ(info->num_erases, 0);
|
|
2989
|
+
ASSERT_EQ(info->max_probe_length, 0);
|
|
2990
|
+
ASSERT_EQ(info->total_probe_length, 0);
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2994
|
+
// This tests that reserve on a full SOO table doesn't incorrectly result in new
|
|
2995
|
+
// (over-)sampling.
|
|
2996
|
+
TEST(RawHashSamplerTest, SooTableReserveToFullSoo) {
|
|
2997
|
+
if (SooInt32Table().capacity() != SooCapacity()) {
|
|
2998
|
+
CHECK_LT(sizeof(void*), 8) << "missing SOO coverage";
|
|
2999
|
+
GTEST_SKIP() << "not SOO on this platform";
|
|
3000
|
+
}
|
|
3001
|
+
std::vector<const HashtablezInfo*> infos =
|
|
3002
|
+
SampleSooMutation([](SooInt32Table& t) {
|
|
3003
|
+
t.insert(1);
|
|
3004
|
+
t.reserve(100);
|
|
3005
|
+
});
|
|
3006
|
+
|
|
3007
|
+
for (const HashtablezInfo* info : infos) {
|
|
3008
|
+
ASSERT_EQ(info->inline_element_size,
|
|
3009
|
+
sizeof(typename SooInt32Table::value_type));
|
|
3010
|
+
ASSERT_EQ(info->soo_capacity, SooCapacity());
|
|
3011
|
+
ASSERT_GE(info->capacity, 100);
|
|
3012
|
+
ASSERT_EQ(info->size, 1);
|
|
3013
|
+
ASSERT_EQ(info->max_reserve, 100);
|
|
3014
|
+
ASSERT_EQ(info->num_erases, 0);
|
|
3015
|
+
ASSERT_EQ(info->max_probe_length, 0);
|
|
3016
|
+
ASSERT_EQ(info->total_probe_length, 0);
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
TEST(RawHashSamplerTest, SooTableSampleOnCopy) {
|
|
3021
|
+
if (SooInt32Table().capacity() != SooCapacity()) {
|
|
3022
|
+
CHECK_LT(sizeof(void*), 8) << "missing SOO coverage";
|
|
3023
|
+
GTEST_SKIP() << "not SOO on this platform";
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
SooInt32Table t_orig;
|
|
3027
|
+
t_orig.insert(1);
|
|
3028
|
+
|
|
3029
|
+
std::vector<const HashtablezInfo*> infos =
|
|
3030
|
+
SampleSooMutation([&t_orig](SooInt32Table& t) {
|
|
3031
|
+
t = t_orig;
|
|
3032
|
+
});
|
|
3033
|
+
|
|
3034
|
+
for (const HashtablezInfo* info : infos) {
|
|
3035
|
+
ASSERT_EQ(info->inline_element_size,
|
|
3036
|
+
sizeof(typename SooInt32Table::value_type));
|
|
3037
|
+
ASSERT_EQ(info->soo_capacity, SooCapacity());
|
|
3038
|
+
ASSERT_EQ(info->capacity, NextCapacity(SooCapacity()));
|
|
3039
|
+
ASSERT_EQ(info->size, 1);
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
// This tests that rehash(0) on a sampled table with size that fits in SOO
|
|
3044
|
+
// doesn't incorrectly result in losing sampling.
|
|
3045
|
+
TEST(RawHashSamplerTest, SooTableRehashShrinkWhenSizeFitsInSoo) {
|
|
3046
|
+
if (SooInt32Table().capacity() != SooCapacity()) {
|
|
3047
|
+
CHECK_LT(sizeof(void*), 8) << "missing SOO coverage";
|
|
3048
|
+
GTEST_SKIP() << "not SOO on this platform";
|
|
3049
|
+
}
|
|
3050
|
+
std::vector<const HashtablezInfo*> infos =
|
|
3051
|
+
SampleSooMutation([](SooInt32Table& t) {
|
|
3052
|
+
t.reserve(100);
|
|
3053
|
+
t.insert(1);
|
|
3054
|
+
EXPECT_GE(t.capacity(), 100);
|
|
3055
|
+
t.rehash(0);
|
|
3056
|
+
});
|
|
3057
|
+
|
|
3058
|
+
for (const HashtablezInfo* info : infos) {
|
|
3059
|
+
ASSERT_EQ(info->inline_element_size,
|
|
3060
|
+
sizeof(typename SooInt32Table::value_type));
|
|
3061
|
+
ASSERT_EQ(info->soo_capacity, SooCapacity());
|
|
3062
|
+
ASSERT_EQ(info->capacity, NextCapacity(SooCapacity()));
|
|
3063
|
+
ASSERT_EQ(info->size, 1);
|
|
3064
|
+
ASSERT_EQ(info->max_reserve, 100);
|
|
3065
|
+
ASSERT_EQ(info->num_erases, 0);
|
|
3066
|
+
ASSERT_EQ(info->max_probe_length, 0);
|
|
3067
|
+
ASSERT_EQ(info->total_probe_length, 0);
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
#endif // ABSL_INTERNAL_HASHTABLEZ_SAMPLE
|
|
3071
|
+
|
|
3072
|
+
TEST(RawHashSamplerTest, DoNotSampleCustomAllocators) {
|
|
3073
|
+
// Enable the feature even if the prod default is off.
|
|
3074
|
+
SetSamplingRateTo1Percent();
|
|
3075
|
+
|
|
3076
|
+
auto& sampler = GlobalHashtablezSampler();
|
|
3077
|
+
int64_t start_size = 0;
|
|
3078
|
+
start_size += sampler.Iterate([&](const HashtablezInfo&) { ++start_size; });
|
|
3079
|
+
|
|
3080
|
+
std::vector<CustomAllocIntTable> tables;
|
|
3081
|
+
for (int i = 0; i < 100000; ++i) {
|
|
3082
|
+
tables.emplace_back();
|
|
3083
|
+
tables.back().insert(1);
|
|
3084
|
+
tables.push_back(tables.back()); // Copies the table.
|
|
3085
|
+
}
|
|
3086
|
+
int64_t end_size = 0;
|
|
3087
|
+
end_size += sampler.Iterate([&](const HashtablezInfo&) { ++end_size; });
|
|
3088
|
+
|
|
3089
|
+
EXPECT_NEAR((end_size - start_size) / static_cast<double>(tables.size()),
|
|
3090
|
+
0.00, 0.001);
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
#ifdef ABSL_HAVE_ADDRESS_SANITIZER
|
|
3094
|
+
template <class TableType>
|
|
3095
|
+
class SanitizerTest : public testing::Test {};
|
|
3096
|
+
|
|
3097
|
+
using SanitizerTableTypes = ::testing::Types<IntTable, TransferableIntTable>;
|
|
3098
|
+
TYPED_TEST_SUITE(SanitizerTest, SanitizerTableTypes);
|
|
3099
|
+
|
|
3100
|
+
TYPED_TEST(SanitizerTest, PoisoningUnused) {
|
|
3101
|
+
TypeParam t;
|
|
3102
|
+
for (size_t reserve_size = 2; reserve_size < 1024;
|
|
3103
|
+
reserve_size = reserve_size * 3 / 2) {
|
|
3104
|
+
t.reserve(reserve_size);
|
|
3105
|
+
// Insert something to force an allocation.
|
|
3106
|
+
int64_t& v = *t.insert(0).first;
|
|
3107
|
+
|
|
3108
|
+
// Make sure there is something to test.
|
|
3109
|
+
ASSERT_GT(t.capacity(), 1);
|
|
3110
|
+
|
|
3111
|
+
int64_t* slots = RawHashSetTestOnlyAccess::GetSlots(t);
|
|
3112
|
+
for (size_t i = 0; i < t.capacity(); ++i) {
|
|
3113
|
+
EXPECT_EQ(slots + i != &v, __asan_address_is_poisoned(slots + i)) << i;
|
|
3114
|
+
}
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
TYPED_TEST(SanitizerTest, PoisoningUnusedOnGrowth) {
|
|
3119
|
+
TypeParam t;
|
|
3120
|
+
for (int64_t i = 0; i < 100; ++i) {
|
|
3121
|
+
t.insert(i);
|
|
3122
|
+
|
|
3123
|
+
int64_t* slots = RawHashSetTestOnlyAccess::GetSlots(t);
|
|
3124
|
+
int poisoned = 0;
|
|
3125
|
+
for (size_t i = 0; i < t.capacity(); ++i) {
|
|
3126
|
+
poisoned += static_cast<int>(__asan_address_is_poisoned(slots + i));
|
|
3127
|
+
}
|
|
3128
|
+
ASSERT_EQ(poisoned, t.capacity() - t.size());
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
// TODO(b/289225379): poison inline space when empty SOO.
|
|
3133
|
+
TEST(Sanitizer, PoisoningOnErase) {
|
|
3134
|
+
NonSooIntTable t;
|
|
3135
|
+
auto& v = *t.insert(0).first;
|
|
3136
|
+
|
|
3137
|
+
EXPECT_FALSE(__asan_address_is_poisoned(&v));
|
|
3138
|
+
t.erase(0);
|
|
3139
|
+
EXPECT_TRUE(__asan_address_is_poisoned(&v));
|
|
3140
|
+
}
|
|
3141
|
+
#endif // ABSL_HAVE_ADDRESS_SANITIZER
|
|
3142
|
+
|
|
3143
|
+
template <typename T>
|
|
3144
|
+
class AlignOneTest : public ::testing::Test {};
|
|
3145
|
+
using AlignOneTestTypes =
|
|
3146
|
+
::testing::Types<Uint8Table, MinimumAlignmentUint8Table>;
|
|
3147
|
+
TYPED_TEST_SUITE(AlignOneTest, AlignOneTestTypes);
|
|
3148
|
+
|
|
3149
|
+
TYPED_TEST(AlignOneTest, AlignOne) {
|
|
3150
|
+
// We previously had a bug in which we were copying a control byte over the
|
|
3151
|
+
// first slot when alignof(value_type) is 1. We test repeated
|
|
3152
|
+
// insertions/erases and verify that the behavior is correct.
|
|
3153
|
+
TypeParam t;
|
|
3154
|
+
std::bitset<256> verifier;
|
|
3155
|
+
|
|
3156
|
+
// Do repeated insertions/erases from the table.
|
|
3157
|
+
for (int64_t i = 0; i < 10000; ++i) {
|
|
3158
|
+
SCOPED_TRACE(i);
|
|
3159
|
+
const uint8_t u = (i * -i) & 0xFF;
|
|
3160
|
+
auto it = t.find(u);
|
|
3161
|
+
if (it == t.end()) {
|
|
3162
|
+
ASSERT_FALSE(verifier.test(u));
|
|
3163
|
+
t.insert(u);
|
|
3164
|
+
verifier.set(u);
|
|
3165
|
+
} else {
|
|
3166
|
+
ASSERT_TRUE(verifier.test(u));
|
|
3167
|
+
t.erase(it);
|
|
3168
|
+
verifier.reset(u);
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
EXPECT_EQ(t.size(), verifier.count());
|
|
3173
|
+
for (uint8_t u : t) {
|
|
3174
|
+
ASSERT_TRUE(verifier.test(u));
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
TEST(Iterator, InvalidUseCrashesWithSanitizers) {
|
|
3179
|
+
if (!SwisstableGenerationsEnabled()) GTEST_SKIP() << "Generations disabled.";
|
|
3180
|
+
if (kMsvc) GTEST_SKIP() << "MSVC doesn't support | in regexp.";
|
|
3181
|
+
|
|
3182
|
+
NonSooIntTable t;
|
|
3183
|
+
// Start with 1 element so that `it` is never an end iterator.
|
|
3184
|
+
t.insert(-1);
|
|
3185
|
+
for (int i = 0; i < 10; ++i) {
|
|
3186
|
+
auto it = t.begin();
|
|
3187
|
+
t.insert(i);
|
|
3188
|
+
EXPECT_DEATH_IF_SUPPORTED(*it, kInvalidIteratorDeathMessage);
|
|
3189
|
+
EXPECT_DEATH_IF_SUPPORTED(void(it == t.begin()),
|
|
3190
|
+
kInvalidIteratorDeathMessage);
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
|
|
3194
|
+
TEST(Iterator, InvalidUseWithReserveCrashesWithSanitizers) {
|
|
3195
|
+
if (!SwisstableGenerationsEnabled()) GTEST_SKIP() << "Generations disabled.";
|
|
3196
|
+
if (kMsvc) GTEST_SKIP() << "MSVC doesn't support | in regexp.";
|
|
3197
|
+
|
|
3198
|
+
IntTable t;
|
|
3199
|
+
t.reserve(10);
|
|
3200
|
+
t.insert(0);
|
|
3201
|
+
auto it = t.begin();
|
|
3202
|
+
// Reserved growth can't rehash.
|
|
3203
|
+
for (int i = 1; i < 10; ++i) {
|
|
3204
|
+
t.insert(i);
|
|
3205
|
+
EXPECT_EQ(*it, 0);
|
|
3206
|
+
}
|
|
3207
|
+
// ptr will become invalidated on rehash.
|
|
3208
|
+
const int64_t* ptr = &*it;
|
|
3209
|
+
(void)ptr;
|
|
3210
|
+
|
|
3211
|
+
// erase decreases size but does not decrease reserved growth so the next
|
|
3212
|
+
// insertion still invalidates iterators.
|
|
3213
|
+
t.erase(0);
|
|
3214
|
+
// The first insert after reserved growth is 0 is guaranteed to rehash when
|
|
3215
|
+
// generations are enabled.
|
|
3216
|
+
t.insert(10);
|
|
3217
|
+
EXPECT_DEATH_IF_SUPPORTED(*it, kInvalidIteratorDeathMessage);
|
|
3218
|
+
EXPECT_DEATH_IF_SUPPORTED(void(it == t.begin()),
|
|
3219
|
+
kInvalidIteratorDeathMessage);
|
|
3220
|
+
#ifdef ABSL_HAVE_ADDRESS_SANITIZER
|
|
3221
|
+
EXPECT_DEATH_IF_SUPPORTED(std::cout << *ptr, "heap-use-after-free");
|
|
3222
|
+
#endif
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3225
|
+
TEST(Iterator, InvalidUseWithMoveCrashesWithSanitizers) {
|
|
3226
|
+
if (!SwisstableGenerationsEnabled()) GTEST_SKIP() << "Generations disabled.";
|
|
3227
|
+
if (kMsvc) GTEST_SKIP() << "MSVC doesn't support | in regexp.";
|
|
3228
|
+
|
|
3229
|
+
NonSooIntTable t1, t2;
|
|
3230
|
+
t1.insert(1);
|
|
3231
|
+
auto it = t1.begin();
|
|
3232
|
+
// ptr will become invalidated on rehash.
|
|
3233
|
+
const auto* ptr = &*it;
|
|
3234
|
+
(void)ptr;
|
|
3235
|
+
|
|
3236
|
+
t2 = std::move(t1);
|
|
3237
|
+
EXPECT_DEATH_IF_SUPPORTED(*it, kInvalidIteratorDeathMessage);
|
|
3238
|
+
EXPECT_DEATH_IF_SUPPORTED(void(it == t2.begin()),
|
|
3239
|
+
kInvalidIteratorDeathMessage);
|
|
3240
|
+
#ifdef ABSL_HAVE_ADDRESS_SANITIZER
|
|
3241
|
+
EXPECT_DEATH_IF_SUPPORTED(std::cout << **ptr, "heap-use-after-free");
|
|
3242
|
+
#endif
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3245
|
+
TYPED_TEST(SooTest, ReservedGrowthUpdatesWhenTableDoesntGrow) {
|
|
3246
|
+
TypeParam t;
|
|
3247
|
+
for (int i = 0; i < 8; ++i) t.insert(i);
|
|
3248
|
+
// Want to insert twice without invalidating iterators so reserve.
|
|
3249
|
+
const size_t cap = t.capacity();
|
|
3250
|
+
t.reserve(t.size() + 2);
|
|
3251
|
+
// We want to be testing the case in which the reserve doesn't grow the table.
|
|
3252
|
+
ASSERT_EQ(cap, t.capacity());
|
|
3253
|
+
auto it = t.find(0);
|
|
3254
|
+
t.insert(100);
|
|
3255
|
+
t.insert(200);
|
|
3256
|
+
// `it` shouldn't have been invalidated.
|
|
3257
|
+
EXPECT_EQ(*it, 0);
|
|
3258
|
+
}
|
|
3259
|
+
|
|
3260
|
+
template <class TableType>
|
|
3261
|
+
class InstanceTrackerTest : public testing::Test {};
|
|
3262
|
+
|
|
3263
|
+
using ::absl::test_internal::CopyableMovableInstance;
|
|
3264
|
+
using ::absl::test_internal::InstanceTracker;
|
|
3265
|
+
|
|
3266
|
+
struct InstanceTrackerHash {
|
|
3267
|
+
size_t operator()(const CopyableMovableInstance& t) const {
|
|
3268
|
+
return absl::HashOf(t.value());
|
|
3269
|
+
}
|
|
3270
|
+
};
|
|
3271
|
+
|
|
3272
|
+
using InstanceTrackerTableTypes = ::testing::Types<
|
|
3273
|
+
absl::node_hash_set<CopyableMovableInstance, InstanceTrackerHash>,
|
|
3274
|
+
absl::flat_hash_set<CopyableMovableInstance, InstanceTrackerHash>>;
|
|
3275
|
+
TYPED_TEST_SUITE(InstanceTrackerTest, InstanceTrackerTableTypes);
|
|
3276
|
+
|
|
3277
|
+
TYPED_TEST(InstanceTrackerTest, EraseIfAll) {
|
|
3278
|
+
using Table = TypeParam;
|
|
3279
|
+
InstanceTracker tracker;
|
|
3280
|
+
for (int size = 0; size < 100; ++size) {
|
|
3281
|
+
Table t;
|
|
3282
|
+
for (int i = 0; i < size; ++i) {
|
|
3283
|
+
t.emplace(i);
|
|
3284
|
+
}
|
|
3285
|
+
absl::erase_if(t, [](const auto&) { return true; });
|
|
3286
|
+
ASSERT_EQ(t.size(), 0);
|
|
3287
|
+
}
|
|
3288
|
+
EXPECT_EQ(tracker.live_instances(), 0);
|
|
3289
|
+
}
|
|
3290
|
+
|
|
3291
|
+
TYPED_TEST(InstanceTrackerTest, EraseIfNone) {
|
|
3292
|
+
using Table = TypeParam;
|
|
3293
|
+
InstanceTracker tracker;
|
|
3294
|
+
{
|
|
3295
|
+
Table t;
|
|
3296
|
+
for (size_t size = 0; size < 100; ++size) {
|
|
3297
|
+
absl::erase_if(t, [](const auto&) { return false; });
|
|
3298
|
+
ASSERT_EQ(t.size(), size);
|
|
3299
|
+
t.emplace(size);
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
EXPECT_EQ(tracker.live_instances(), 0);
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
TYPED_TEST(InstanceTrackerTest, EraseIfPartial) {
|
|
3306
|
+
using Table = TypeParam;
|
|
3307
|
+
InstanceTracker tracker;
|
|
3308
|
+
for (int mod : {0, 1}) {
|
|
3309
|
+
for (int size = 0; size < 100; ++size) {
|
|
3310
|
+
SCOPED_TRACE(absl::StrCat(mod, " ", size));
|
|
3311
|
+
Table t;
|
|
3312
|
+
std::vector<CopyableMovableInstance> expected;
|
|
3313
|
+
for (int i = 0; i < size; ++i) {
|
|
3314
|
+
t.emplace(i);
|
|
3315
|
+
if (i % 2 != mod) {
|
|
3316
|
+
expected.emplace_back(i);
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
absl::erase_if(t, [mod](const auto& x) { return x.value() % 2 == mod; });
|
|
3320
|
+
ASSERT_THAT(t, testing::UnorderedElementsAreArray(expected));
|
|
3321
|
+
}
|
|
3322
|
+
}
|
|
3323
|
+
EXPECT_EQ(tracker.live_instances(), 0);
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
TYPED_TEST(SooTest, EraseIfAll) {
|
|
3327
|
+
auto pred = [](const auto&) { return true; };
|
|
3328
|
+
for (int size = 0; size < 100; ++size) {
|
|
3329
|
+
TypeParam t;
|
|
3330
|
+
for (int i = 0; i < size; ++i) t.insert(i);
|
|
3331
|
+
absl::container_internal::EraseIf(pred, &t);
|
|
3332
|
+
ASSERT_EQ(t.size(), 0);
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3336
|
+
TYPED_TEST(SooTest, EraseIfNone) {
|
|
3337
|
+
auto pred = [](const auto&) { return false; };
|
|
3338
|
+
TypeParam t;
|
|
3339
|
+
for (size_t size = 0; size < 100; ++size) {
|
|
3340
|
+
absl::container_internal::EraseIf(pred, &t);
|
|
3341
|
+
ASSERT_EQ(t.size(), size);
|
|
3342
|
+
t.insert(size);
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
TYPED_TEST(SooTest, EraseIfPartial) {
|
|
3347
|
+
for (int mod : {0, 1}) {
|
|
3348
|
+
auto pred = [&](const auto& x) {
|
|
3349
|
+
return static_cast<int64_t>(x) % 2 == mod;
|
|
3350
|
+
};
|
|
3351
|
+
for (int size = 0; size < 100; ++size) {
|
|
3352
|
+
SCOPED_TRACE(absl::StrCat(mod, " ", size));
|
|
3353
|
+
TypeParam t;
|
|
3354
|
+
std::vector<int64_t> expected;
|
|
3355
|
+
for (int i = 0; i < size; ++i) {
|
|
3356
|
+
t.insert(i);
|
|
3357
|
+
if (i % 2 != mod) {
|
|
3358
|
+
expected.push_back(i);
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
absl::container_internal::EraseIf(pred, &t);
|
|
3362
|
+
ASSERT_THAT(t, testing::UnorderedElementsAreArray(expected));
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
TYPED_TEST(SooTest, ForEach) {
|
|
3368
|
+
TypeParam t;
|
|
3369
|
+
std::vector<int64_t> expected;
|
|
3370
|
+
for (int size = 0; size < 100; ++size) {
|
|
3371
|
+
SCOPED_TRACE(size);
|
|
3372
|
+
{
|
|
3373
|
+
SCOPED_TRACE("mutable iteration");
|
|
3374
|
+
std::vector<int64_t> actual;
|
|
3375
|
+
auto f = [&](auto& x) { actual.push_back(static_cast<int64_t>(x)); };
|
|
3376
|
+
absl::container_internal::ForEach(f, &t);
|
|
3377
|
+
ASSERT_THAT(actual, testing::UnorderedElementsAreArray(expected));
|
|
3378
|
+
}
|
|
3379
|
+
{
|
|
3380
|
+
SCOPED_TRACE("const iteration");
|
|
3381
|
+
std::vector<int64_t> actual;
|
|
3382
|
+
auto f = [&](auto& x) {
|
|
3383
|
+
static_assert(
|
|
3384
|
+
std::is_const<std::remove_reference_t<decltype(x)>>::value,
|
|
3385
|
+
"no mutable values should be passed to const ForEach");
|
|
3386
|
+
actual.push_back(static_cast<int64_t>(x));
|
|
3387
|
+
};
|
|
3388
|
+
const auto& ct = t;
|
|
3389
|
+
absl::container_internal::ForEach(f, &ct);
|
|
3390
|
+
ASSERT_THAT(actual, testing::UnorderedElementsAreArray(expected));
|
|
3391
|
+
}
|
|
3392
|
+
t.insert(size);
|
|
3393
|
+
expected.push_back(size);
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3397
|
+
TEST(Table, ForEachMutate) {
|
|
3398
|
+
StringTable t;
|
|
3399
|
+
using ValueType = StringTable::value_type;
|
|
3400
|
+
std::vector<ValueType> expected;
|
|
3401
|
+
for (int size = 0; size < 100; ++size) {
|
|
3402
|
+
SCOPED_TRACE(size);
|
|
3403
|
+
std::vector<ValueType> actual;
|
|
3404
|
+
auto f = [&](ValueType& x) {
|
|
3405
|
+
actual.push_back(x);
|
|
3406
|
+
x.second += "a";
|
|
3407
|
+
};
|
|
3408
|
+
absl::container_internal::ForEach(f, &t);
|
|
3409
|
+
ASSERT_THAT(actual, testing::UnorderedElementsAreArray(expected));
|
|
3410
|
+
for (ValueType& v : expected) {
|
|
3411
|
+
v.second += "a";
|
|
3412
|
+
}
|
|
3413
|
+
ASSERT_THAT(t, testing::UnorderedElementsAreArray(expected));
|
|
3414
|
+
t.emplace(std::to_string(size), std::to_string(size));
|
|
3415
|
+
expected.emplace_back(std::to_string(size), std::to_string(size));
|
|
3416
|
+
}
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
TYPED_TEST(SooTest, EraseIfReentryDeath) {
|
|
3420
|
+
if (!IsAssertEnabled()) GTEST_SKIP() << "Assertions not enabled.";
|
|
3421
|
+
|
|
3422
|
+
auto erase_if_with_removal_reentrance = [](size_t reserve_size) {
|
|
3423
|
+
TypeParam t;
|
|
3424
|
+
t.reserve(reserve_size);
|
|
3425
|
+
int64_t first_value = -1;
|
|
3426
|
+
t.insert(1024);
|
|
3427
|
+
t.insert(5078);
|
|
3428
|
+
auto pred = [&](const auto& x) {
|
|
3429
|
+
if (first_value == -1) {
|
|
3430
|
+
first_value = static_cast<int64_t>(x);
|
|
3431
|
+
return false;
|
|
3432
|
+
}
|
|
3433
|
+
// We erase on second call to `pred` to reduce the chance that assertion
|
|
3434
|
+
// will happen in IterateOverFullSlots.
|
|
3435
|
+
t.erase(first_value);
|
|
3436
|
+
return true;
|
|
3437
|
+
};
|
|
3438
|
+
absl::container_internal::EraseIf(pred, &t);
|
|
3439
|
+
};
|
|
3440
|
+
// Removal will likely happen in a different group.
|
|
3441
|
+
EXPECT_DEATH_IF_SUPPORTED(erase_if_with_removal_reentrance(1024 * 16),
|
|
3442
|
+
"hash table was modified unexpectedly");
|
|
3443
|
+
// Removal will happen in the same group.
|
|
3444
|
+
EXPECT_DEATH_IF_SUPPORTED(
|
|
3445
|
+
erase_if_with_removal_reentrance(CapacityToGrowth(Group::kWidth - 1)),
|
|
3446
|
+
"hash table was modified unexpectedly");
|
|
3447
|
+
}
|
|
3448
|
+
|
|
3449
|
+
// This test is useful to test soo branch.
|
|
3450
|
+
TYPED_TEST(SooTest, EraseIfReentrySingleElementDeath) {
|
|
3451
|
+
if (!IsAssertEnabled()) GTEST_SKIP() << "Assertions not enabled.";
|
|
3452
|
+
|
|
3453
|
+
auto erase_if_with_removal_reentrance = []() {
|
|
3454
|
+
TypeParam t;
|
|
3455
|
+
t.insert(1024);
|
|
3456
|
+
auto pred = [&](const auto& x) {
|
|
3457
|
+
// We erase ourselves in order to confuse the erase_if.
|
|
3458
|
+
t.erase(static_cast<int64_t>(x));
|
|
3459
|
+
return false;
|
|
3460
|
+
};
|
|
3461
|
+
absl::container_internal::EraseIf(pred, &t);
|
|
3462
|
+
};
|
|
3463
|
+
EXPECT_DEATH_IF_SUPPORTED(erase_if_with_removal_reentrance(),
|
|
3464
|
+
"hash table was modified unexpectedly");
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
TEST(Table, EraseBeginEndResetsReservedGrowth) {
|
|
3468
|
+
bool frozen = false;
|
|
3469
|
+
BadHashFreezableIntTable t{FreezableAlloc<int64_t>(&frozen)};
|
|
3470
|
+
t.reserve(100);
|
|
3471
|
+
const size_t cap = t.capacity();
|
|
3472
|
+
frozen = true; // no further allocs allowed
|
|
3473
|
+
|
|
3474
|
+
for (int i = 0; i < 10; ++i) {
|
|
3475
|
+
// Create a long run (hash function returns constant).
|
|
3476
|
+
for (int j = 0; j < 100; ++j) t.insert(j);
|
|
3477
|
+
// Erase elements from the middle of the long run, which creates
|
|
3478
|
+
// tombstones.
|
|
3479
|
+
for (int j = 30; j < 60; ++j) t.erase(j);
|
|
3480
|
+
EXPECT_EQ(t.size(), 70);
|
|
3481
|
+
EXPECT_EQ(t.capacity(), cap);
|
|
3482
|
+
ASSERT_EQ(RawHashSetTestOnlyAccess::CountTombstones(t), 30);
|
|
3483
|
+
|
|
3484
|
+
t.erase(t.begin(), t.end());
|
|
3485
|
+
|
|
3486
|
+
EXPECT_EQ(t.size(), 0);
|
|
3487
|
+
EXPECT_EQ(t.capacity(), cap);
|
|
3488
|
+
ASSERT_EQ(RawHashSetTestOnlyAccess::CountTombstones(t), 0);
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
|
|
3492
|
+
TEST(Table, GenerationInfoResetsOnClear) {
|
|
3493
|
+
if (!SwisstableGenerationsEnabled()) GTEST_SKIP() << "Generations disabled.";
|
|
3494
|
+
if (kMsvc) GTEST_SKIP() << "MSVC doesn't support | in regexp.";
|
|
3495
|
+
|
|
3496
|
+
NonSooIntTable t;
|
|
3497
|
+
for (int i = 0; i < 1000; ++i) t.insert(i);
|
|
3498
|
+
t.reserve(t.size() + 100);
|
|
3499
|
+
|
|
3500
|
+
t.clear();
|
|
3501
|
+
|
|
3502
|
+
t.insert(0);
|
|
3503
|
+
auto it = t.begin();
|
|
3504
|
+
t.insert(1);
|
|
3505
|
+
EXPECT_DEATH_IF_SUPPORTED(*it, kInvalidIteratorDeathMessage);
|
|
3506
|
+
}
|
|
3507
|
+
|
|
3508
|
+
TEST(Table, InvalidReferenceUseCrashesWithSanitizers) {
|
|
3509
|
+
if (!SwisstableGenerationsEnabled()) GTEST_SKIP() << "Generations disabled.";
|
|
3510
|
+
#ifdef ABSL_HAVE_MEMORY_SANITIZER
|
|
3511
|
+
GTEST_SKIP() << "MSan fails to detect some of these rehashes.";
|
|
3512
|
+
#endif
|
|
3513
|
+
|
|
3514
|
+
NonSooIntTable t;
|
|
3515
|
+
t.insert(0);
|
|
3516
|
+
// Rehashing is guaranteed on every insertion while capacity is less than
|
|
3517
|
+
// RehashProbabilityConstant().
|
|
3518
|
+
int i = 0;
|
|
3519
|
+
while (t.capacity() <= RehashProbabilityConstant()) {
|
|
3520
|
+
// ptr will become invalidated on rehash.
|
|
3521
|
+
const auto* ptr = &*t.begin();
|
|
3522
|
+
t.insert(++i);
|
|
3523
|
+
EXPECT_DEATH_IF_SUPPORTED(std::cout << **ptr, "use-after-free") << i;
|
|
3524
|
+
}
|
|
3525
|
+
}
|
|
3526
|
+
|
|
3527
|
+
TEST(Iterator, InvalidComparisonDifferentTables) {
|
|
3528
|
+
if (!SwisstableGenerationsEnabled()) GTEST_SKIP() << "Generations disabled.";
|
|
3529
|
+
|
|
3530
|
+
NonSooIntTable t1, t2;
|
|
3531
|
+
NonSooIntTable::iterator default_constructed_iter;
|
|
3532
|
+
// We randomly use one of N empty generations for generations from empty
|
|
3533
|
+
// hashtables. In general, we won't always detect when iterators from
|
|
3534
|
+
// different empty hashtables are compared, but in this test case, we
|
|
3535
|
+
// should deterministically detect the error due to our randomness yielding
|
|
3536
|
+
// consecutive random generations.
|
|
3537
|
+
EXPECT_DEATH_IF_SUPPORTED(void(t1.end() == t2.end()),
|
|
3538
|
+
"Invalid iterator comparison.*empty hashtables");
|
|
3539
|
+
EXPECT_DEATH_IF_SUPPORTED(void(t1.end() == default_constructed_iter),
|
|
3540
|
+
"Invalid iterator comparison.*default-constructed");
|
|
3541
|
+
t1.insert(0);
|
|
3542
|
+
t1.insert(1);
|
|
3543
|
+
EXPECT_DEATH_IF_SUPPORTED(void(t1.begin() == t2.end()),
|
|
3544
|
+
"Invalid iterator comparison.*empty hashtable");
|
|
3545
|
+
EXPECT_DEATH_IF_SUPPORTED(void(t1.begin() == default_constructed_iter),
|
|
3546
|
+
"Invalid iterator comparison.*default-constructed");
|
|
3547
|
+
t2.insert(0);
|
|
3548
|
+
t2.insert(1);
|
|
3549
|
+
EXPECT_DEATH_IF_SUPPORTED(void(t1.begin() == t2.end()),
|
|
3550
|
+
"Invalid iterator comparison.*end.. iterator");
|
|
3551
|
+
EXPECT_DEATH_IF_SUPPORTED(void(t1.begin() == t2.begin()),
|
|
3552
|
+
"Invalid iterator comparison.*non-end");
|
|
3553
|
+
}
|
|
3554
|
+
|
|
3555
|
+
template <typename Alloc>
|
|
3556
|
+
using RawHashSetAlloc = raw_hash_set<IntPolicy, hash_default_hash<int64_t>,
|
|
3557
|
+
std::equal_to<int64_t>, Alloc>;
|
|
3558
|
+
|
|
3559
|
+
TEST(Table, AllocatorPropagation) { TestAllocPropagation<RawHashSetAlloc>(); }
|
|
3560
|
+
|
|
3561
|
+
struct CountedHash {
|
|
3562
|
+
size_t operator()(int64_t value) const {
|
|
3563
|
+
++count;
|
|
3564
|
+
return static_cast<size_t>(value);
|
|
3565
|
+
}
|
|
3566
|
+
mutable int count = 0;
|
|
3567
|
+
};
|
|
3568
|
+
|
|
3569
|
+
struct CountedHashIntTable
|
|
3570
|
+
: raw_hash_set<IntPolicy, CountedHash, std::equal_to<int>,
|
|
3571
|
+
std::allocator<int>> {
|
|
3572
|
+
using Base = typename CountedHashIntTable::raw_hash_set;
|
|
3573
|
+
using Base::Base;
|
|
3574
|
+
};
|
|
3575
|
+
|
|
3576
|
+
TEST(Table, CountedHash) {
|
|
3577
|
+
// Verify that raw_hash_set does not compute redundant hashes.
|
|
3578
|
+
#ifdef NDEBUG
|
|
3579
|
+
constexpr bool kExpectMinimumHashes = true;
|
|
3580
|
+
#else
|
|
3581
|
+
constexpr bool kExpectMinimumHashes = false;
|
|
3582
|
+
#endif
|
|
3583
|
+
if (!kExpectMinimumHashes) {
|
|
3584
|
+
GTEST_SKIP() << "Only run under NDEBUG: `assert` statements may cause "
|
|
3585
|
+
"redundant hashing.";
|
|
3586
|
+
}
|
|
3587
|
+
// When the table is sampled, we need to hash on the first insertion.
|
|
3588
|
+
DisableSampling();
|
|
3589
|
+
|
|
3590
|
+
using Table = CountedHashIntTable;
|
|
3591
|
+
auto HashCount = [](const Table& t) { return t.hash_function().count; };
|
|
3592
|
+
{
|
|
3593
|
+
Table t;
|
|
3594
|
+
t.find(0);
|
|
3595
|
+
EXPECT_EQ(HashCount(t), 0);
|
|
3596
|
+
}
|
|
3597
|
+
{
|
|
3598
|
+
Table t;
|
|
3599
|
+
t.insert(1);
|
|
3600
|
+
t.find(1);
|
|
3601
|
+
EXPECT_EQ(HashCount(t), 0);
|
|
3602
|
+
t.erase(1);
|
|
3603
|
+
EXPECT_EQ(HashCount(t), 0);
|
|
3604
|
+
t.insert(1);
|
|
3605
|
+
t.insert(2);
|
|
3606
|
+
EXPECT_EQ(HashCount(t), 2);
|
|
3607
|
+
}
|
|
3608
|
+
{
|
|
3609
|
+
Table t;
|
|
3610
|
+
t.insert(3);
|
|
3611
|
+
EXPECT_EQ(HashCount(t), 0);
|
|
3612
|
+
auto node = t.extract(3);
|
|
3613
|
+
EXPECT_EQ(HashCount(t), 0);
|
|
3614
|
+
t.insert(std::move(node));
|
|
3615
|
+
EXPECT_EQ(HashCount(t), 0);
|
|
3616
|
+
}
|
|
3617
|
+
{
|
|
3618
|
+
Table t;
|
|
3619
|
+
t.emplace(5);
|
|
3620
|
+
EXPECT_EQ(HashCount(t), 0);
|
|
3621
|
+
}
|
|
3622
|
+
{
|
|
3623
|
+
Table src;
|
|
3624
|
+
src.insert(7);
|
|
3625
|
+
Table dst;
|
|
3626
|
+
dst.merge(src);
|
|
3627
|
+
EXPECT_EQ(HashCount(dst), 0);
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
|
|
3631
|
+
// IterateOverFullSlots doesn't support SOO.
|
|
3632
|
+
TEST(Table, IterateOverFullSlotsEmpty) {
|
|
3633
|
+
NonSooIntTable t;
|
|
3634
|
+
using SlotType = NonSooIntTableSlotType;
|
|
3635
|
+
auto fail_if_any = [](const ctrl_t*, void* i) {
|
|
3636
|
+
FAIL() << "expected no slots " << **static_cast<SlotType*>(i);
|
|
3637
|
+
};
|
|
3638
|
+
for (size_t i = 2; i < 256; ++i) {
|
|
3639
|
+
t.reserve(i);
|
|
3640
|
+
container_internal::IterateOverFullSlots(
|
|
3641
|
+
RawHashSetTestOnlyAccess::GetCommon(t), sizeof(SlotType), fail_if_any);
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
|
|
3645
|
+
TEST(Table, IterateOverFullSlotsFull) {
|
|
3646
|
+
NonSooIntTable t;
|
|
3647
|
+
using SlotType = NonSooIntTableSlotType;
|
|
3648
|
+
|
|
3649
|
+
std::vector<int64_t> expected_slots;
|
|
3650
|
+
t.insert(0);
|
|
3651
|
+
expected_slots.push_back(0);
|
|
3652
|
+
for (int64_t idx = 1; idx < 128; ++idx) {
|
|
3653
|
+
t.insert(idx);
|
|
3654
|
+
expected_slots.push_back(idx);
|
|
3655
|
+
|
|
3656
|
+
std::vector<int64_t> slots;
|
|
3657
|
+
container_internal::IterateOverFullSlots(
|
|
3658
|
+
RawHashSetTestOnlyAccess::GetCommon(t), sizeof(SlotType),
|
|
3659
|
+
[&t, &slots](const ctrl_t* ctrl, void* slot) {
|
|
3660
|
+
SlotType* i = static_cast<SlotType*>(slot);
|
|
3661
|
+
ptrdiff_t ctrl_offset =
|
|
3662
|
+
ctrl - RawHashSetTestOnlyAccess::GetCommon(t).control();
|
|
3663
|
+
ptrdiff_t slot_offset = i - RawHashSetTestOnlyAccess::GetSlots(t);
|
|
3664
|
+
ASSERT_EQ(ctrl_offset, slot_offset);
|
|
3665
|
+
slots.push_back(**i);
|
|
3666
|
+
});
|
|
3667
|
+
EXPECT_THAT(slots, testing::UnorderedElementsAreArray(expected_slots));
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
|
|
3671
|
+
TEST(Table, IterateOverFullSlotsDeathOnRemoval) {
|
|
3672
|
+
if (!IsAssertEnabled()) GTEST_SKIP() << "Assertions not enabled.";
|
|
3673
|
+
|
|
3674
|
+
auto iterate_with_reentrant_removal = [](int64_t size,
|
|
3675
|
+
int64_t reserve_size = -1) {
|
|
3676
|
+
if (reserve_size == -1) reserve_size = size;
|
|
3677
|
+
for (int64_t idx = 0; idx < size; ++idx) {
|
|
3678
|
+
NonSooIntTable t;
|
|
3679
|
+
using SlotType = NonSooIntTableSlotType;
|
|
3680
|
+
t.reserve(static_cast<size_t>(reserve_size));
|
|
3681
|
+
for (int val = 0; val <= idx; ++val) {
|
|
3682
|
+
t.insert(val);
|
|
3683
|
+
}
|
|
3684
|
+
|
|
3685
|
+
container_internal::IterateOverFullSlots(
|
|
3686
|
+
RawHashSetTestOnlyAccess::GetCommon(t), sizeof(SlotType),
|
|
3687
|
+
[&t](const ctrl_t*, void* slot) {
|
|
3688
|
+
int64_t value = **static_cast<SlotType*>(slot);
|
|
3689
|
+
// Erase the other element from 2*k and 2*k+1 pair.
|
|
3690
|
+
t.erase(value ^ 1);
|
|
3691
|
+
});
|
|
3692
|
+
}
|
|
3693
|
+
};
|
|
3694
|
+
|
|
3695
|
+
EXPECT_DEATH_IF_SUPPORTED(iterate_with_reentrant_removal(128),
|
|
3696
|
+
"hash table was modified unexpectedly");
|
|
3697
|
+
// Removal will likely happen in a different group.
|
|
3698
|
+
EXPECT_DEATH_IF_SUPPORTED(iterate_with_reentrant_removal(14, 1024 * 16),
|
|
3699
|
+
"hash table was modified unexpectedly");
|
|
3700
|
+
// Removal will happen in the same group.
|
|
3701
|
+
EXPECT_DEATH_IF_SUPPORTED(iterate_with_reentrant_removal(static_cast<int64_t>(
|
|
3702
|
+
CapacityToGrowth(Group::kWidth - 1))),
|
|
3703
|
+
"hash table was modified unexpectedly");
|
|
3704
|
+
}
|
|
3705
|
+
|
|
3706
|
+
TEST(Table, IterateOverFullSlotsDeathOnInsert) {
|
|
3707
|
+
if (!IsAssertEnabled()) GTEST_SKIP() << "Assertions not enabled.";
|
|
3708
|
+
|
|
3709
|
+
auto iterate_with_reentrant_insert = [](int64_t reserve_size,
|
|
3710
|
+
int64_t size_divisor = 2) {
|
|
3711
|
+
int64_t size = reserve_size / size_divisor;
|
|
3712
|
+
for (int64_t idx = 1; idx <= size; ++idx) {
|
|
3713
|
+
NonSooIntTable t;
|
|
3714
|
+
using SlotType = NonSooIntTableSlotType;
|
|
3715
|
+
t.reserve(static_cast<size_t>(reserve_size));
|
|
3716
|
+
for (int val = 1; val <= idx; ++val) {
|
|
3717
|
+
t.insert(val);
|
|
3718
|
+
}
|
|
3719
|
+
|
|
3720
|
+
container_internal::IterateOverFullSlots(
|
|
3721
|
+
RawHashSetTestOnlyAccess::GetCommon(t), sizeof(SlotType),
|
|
3722
|
+
[&t](const ctrl_t*, void* slot) {
|
|
3723
|
+
int64_t value = **static_cast<SlotType*>(slot);
|
|
3724
|
+
t.insert(-value);
|
|
3725
|
+
});
|
|
3726
|
+
}
|
|
3727
|
+
};
|
|
3728
|
+
|
|
3729
|
+
EXPECT_DEATH_IF_SUPPORTED(iterate_with_reentrant_insert(128),
|
|
3730
|
+
"hash table was modified unexpectedly");
|
|
3731
|
+
// Insert will likely happen in a different group.
|
|
3732
|
+
EXPECT_DEATH_IF_SUPPORTED(iterate_with_reentrant_insert(1024 * 16, 1024 * 2),
|
|
3733
|
+
"hash table was modified unexpectedly");
|
|
3734
|
+
// Insert will happen in the same group.
|
|
3735
|
+
EXPECT_DEATH_IF_SUPPORTED(iterate_with_reentrant_insert(static_cast<int64_t>(
|
|
3736
|
+
CapacityToGrowth(Group::kWidth - 1))),
|
|
3737
|
+
"hash table was modified unexpectedly");
|
|
3738
|
+
}
|
|
3739
|
+
|
|
3740
|
+
template <typename T>
|
|
3741
|
+
class SooTable : public testing::Test {};
|
|
3742
|
+
using FreezableSooTableTypes =
|
|
3743
|
+
::testing::Types<FreezableSizedValueSooTable<8>,
|
|
3744
|
+
FreezableSizedValueSooTable<16>>;
|
|
3745
|
+
TYPED_TEST_SUITE(SooTable, FreezableSooTableTypes);
|
|
3746
|
+
|
|
3747
|
+
TYPED_TEST(SooTable, Basic) {
|
|
3748
|
+
bool frozen = true;
|
|
3749
|
+
TypeParam t{FreezableAlloc<typename TypeParam::value_type>(&frozen)};
|
|
3750
|
+
if (t.capacity() != SooCapacity()) {
|
|
3751
|
+
CHECK_LT(sizeof(void*), 8) << "missing SOO coverage";
|
|
3752
|
+
GTEST_SKIP() << "not SOO on this platform";
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
t.insert(0);
|
|
3756
|
+
EXPECT_EQ(t.capacity(), 1);
|
|
3757
|
+
auto it = t.find(0);
|
|
3758
|
+
EXPECT_EQ(it, t.begin());
|
|
3759
|
+
ASSERT_NE(it, t.end());
|
|
3760
|
+
EXPECT_EQ(*it, 0);
|
|
3761
|
+
EXPECT_EQ(++it, t.end());
|
|
3762
|
+
EXPECT_EQ(t.find(1), t.end());
|
|
3763
|
+
EXPECT_EQ(t.size(), 1);
|
|
3764
|
+
|
|
3765
|
+
t.erase(0);
|
|
3766
|
+
EXPECT_EQ(t.size(), 0);
|
|
3767
|
+
t.insert(1);
|
|
3768
|
+
it = t.find(1);
|
|
3769
|
+
EXPECT_EQ(it, t.begin());
|
|
3770
|
+
ASSERT_NE(it, t.end());
|
|
3771
|
+
EXPECT_EQ(*it, 1);
|
|
3772
|
+
|
|
3773
|
+
t.clear();
|
|
3774
|
+
EXPECT_EQ(t.size(), 0);
|
|
3775
|
+
}
|
|
3776
|
+
|
|
3777
|
+
TEST(Table, RehashToSooUnsampled) {
|
|
3778
|
+
SooIntTable t;
|
|
3779
|
+
if (t.capacity() != SooCapacity()) {
|
|
3780
|
+
CHECK_LT(sizeof(void*), 8) << "missing SOO coverage";
|
|
3781
|
+
GTEST_SKIP() << "not SOO on this platform";
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3784
|
+
// We disable hashtablez sampling for this test to ensure that the table isn't
|
|
3785
|
+
// sampled. When the table is sampled, it won't rehash down to SOO.
|
|
3786
|
+
DisableSampling();
|
|
3787
|
+
|
|
3788
|
+
t.reserve(100);
|
|
3789
|
+
t.insert(0);
|
|
3790
|
+
EXPECT_EQ(*t.begin(), 0);
|
|
3791
|
+
|
|
3792
|
+
t.rehash(0); // Rehash back down to SOO table.
|
|
3793
|
+
|
|
3794
|
+
EXPECT_EQ(t.capacity(), SooCapacity());
|
|
3795
|
+
EXPECT_EQ(t.size(), 1);
|
|
3796
|
+
EXPECT_EQ(*t.begin(), 0);
|
|
3797
|
+
EXPECT_EQ(t.find(0), t.begin());
|
|
3798
|
+
EXPECT_EQ(t.find(1), t.end());
|
|
3799
|
+
}
|
|
3800
|
+
|
|
3801
|
+
TEST(Table, ReserveToNonSoo) {
|
|
3802
|
+
for (size_t reserve_capacity : {2u, 8u, 100000u}) {
|
|
3803
|
+
SooIntTable t;
|
|
3804
|
+
t.insert(0);
|
|
3805
|
+
|
|
3806
|
+
t.reserve(reserve_capacity);
|
|
3807
|
+
|
|
3808
|
+
EXPECT_EQ(t.find(0), t.begin());
|
|
3809
|
+
EXPECT_EQ(t.size(), 1);
|
|
3810
|
+
EXPECT_EQ(*t.begin(), 0);
|
|
3811
|
+
EXPECT_EQ(t.find(1), t.end());
|
|
3812
|
+
}
|
|
3813
|
+
}
|
|
3814
|
+
|
|
3815
|
+
struct InconsistentHashEqType {
|
|
3816
|
+
InconsistentHashEqType(int v1, int v2) : v1(v1), v2(v2) {}
|
|
3817
|
+
template <typename H>
|
|
3818
|
+
friend H AbslHashValue(H h, InconsistentHashEqType t) {
|
|
3819
|
+
return H::combine(std::move(h), t.v1);
|
|
3820
|
+
}
|
|
3821
|
+
bool operator==(InconsistentHashEqType t) const { return v2 == t.v2; }
|
|
3822
|
+
int v1, v2;
|
|
3823
|
+
};
|
|
3824
|
+
|
|
3825
|
+
TEST(Iterator, InconsistentHashEqFunctorsValidation) {
|
|
3826
|
+
if (!IsAssertEnabled()) GTEST_SKIP() << "Assertions not enabled.";
|
|
3827
|
+
|
|
3828
|
+
ValueTable<InconsistentHashEqType> t;
|
|
3829
|
+
for (int i = 0; i < 10; ++i) t.insert({i, i});
|
|
3830
|
+
// We need to find/insert multiple times to guarantee that we get the
|
|
3831
|
+
// assertion because it's possible for the hash to collide with the inserted
|
|
3832
|
+
// element that has v2==0. In those cases, the new element won't be inserted.
|
|
3833
|
+
auto find_conflicting_elems = [&] {
|
|
3834
|
+
for (int i = 100; i < 20000; ++i) {
|
|
3835
|
+
EXPECT_EQ(t.find({i, 0}), t.end());
|
|
3836
|
+
}
|
|
3837
|
+
};
|
|
3838
|
+
EXPECT_DEATH_IF_SUPPORTED(find_conflicting_elems(),
|
|
3839
|
+
"hash/eq functors are inconsistent.");
|
|
3840
|
+
auto insert_conflicting_elems = [&] {
|
|
3841
|
+
for (int i = 100; i < 20000; ++i) {
|
|
3842
|
+
EXPECT_EQ(t.insert({i, 0}).second, false);
|
|
3843
|
+
}
|
|
3844
|
+
};
|
|
3845
|
+
EXPECT_DEATH_IF_SUPPORTED(insert_conflicting_elems(),
|
|
3846
|
+
"hash/eq functors are inconsistent.");
|
|
3847
|
+
}
|
|
3848
|
+
|
|
3849
|
+
struct ConstructCaller {
|
|
3850
|
+
explicit ConstructCaller(int v) : val(v) {}
|
|
3851
|
+
ConstructCaller(int v, absl::FunctionRef<void()> func) : val(v) { func(); }
|
|
3852
|
+
template <typename H>
|
|
3853
|
+
friend H AbslHashValue(H h, const ConstructCaller& d) {
|
|
3854
|
+
return H::combine(std::move(h), d.val);
|
|
3855
|
+
}
|
|
3856
|
+
bool operator==(const ConstructCaller& c) const { return val == c.val; }
|
|
3857
|
+
|
|
3858
|
+
int val;
|
|
3859
|
+
};
|
|
3860
|
+
|
|
3861
|
+
struct DestroyCaller {
|
|
3862
|
+
explicit DestroyCaller(int v) : val(v) {}
|
|
3863
|
+
DestroyCaller(int v, absl::FunctionRef<void()> func)
|
|
3864
|
+
: val(v), destroy_func(func) {}
|
|
3865
|
+
DestroyCaller(DestroyCaller&& that)
|
|
3866
|
+
: val(that.val), destroy_func(std::move(that.destroy_func)) {
|
|
3867
|
+
that.Deactivate();
|
|
3868
|
+
}
|
|
3869
|
+
~DestroyCaller() {
|
|
3870
|
+
if (destroy_func) (*destroy_func)();
|
|
3871
|
+
}
|
|
3872
|
+
void Deactivate() { destroy_func = absl::nullopt; }
|
|
3873
|
+
|
|
3874
|
+
template <typename H>
|
|
3875
|
+
friend H AbslHashValue(H h, const DestroyCaller& d) {
|
|
3876
|
+
return H::combine(std::move(h), d.val);
|
|
3877
|
+
}
|
|
3878
|
+
bool operator==(const DestroyCaller& d) const { return val == d.val; }
|
|
3879
|
+
|
|
3880
|
+
int val;
|
|
3881
|
+
absl::optional<absl::FunctionRef<void()>> destroy_func;
|
|
3882
|
+
};
|
|
3883
|
+
|
|
3884
|
+
TEST(Table, ReentrantCallsFail) {
|
|
3885
|
+
#ifdef NDEBUG
|
|
3886
|
+
GTEST_SKIP() << "Reentrant checks only enabled in debug mode.";
|
|
3887
|
+
#else
|
|
3888
|
+
{
|
|
3889
|
+
ValueTable<ConstructCaller> t;
|
|
3890
|
+
t.insert(ConstructCaller{0});
|
|
3891
|
+
auto erase_begin = [&] { t.erase(t.begin()); };
|
|
3892
|
+
EXPECT_DEATH_IF_SUPPORTED(t.emplace(1, erase_begin), "");
|
|
3893
|
+
}
|
|
3894
|
+
{
|
|
3895
|
+
ValueTable<DestroyCaller> t;
|
|
3896
|
+
t.insert(DestroyCaller{0});
|
|
3897
|
+
auto find_0 = [&] { t.find(DestroyCaller{0}); };
|
|
3898
|
+
t.insert(DestroyCaller{1, find_0});
|
|
3899
|
+
for (int i = 10; i < 20; ++i) t.insert(DestroyCaller{i});
|
|
3900
|
+
EXPECT_DEATH_IF_SUPPORTED(t.clear(), "");
|
|
3901
|
+
for (auto& elem : t) elem.Deactivate();
|
|
3902
|
+
}
|
|
3903
|
+
{
|
|
3904
|
+
ValueTable<DestroyCaller> t;
|
|
3905
|
+
t.insert(DestroyCaller{0});
|
|
3906
|
+
auto insert_1 = [&] { t.insert(DestroyCaller{1}); };
|
|
3907
|
+
t.insert(DestroyCaller{1, insert_1});
|
|
3908
|
+
for (int i = 10; i < 20; ++i) t.insert(DestroyCaller{i});
|
|
3909
|
+
EXPECT_DEATH_IF_SUPPORTED(t.clear(), "");
|
|
3910
|
+
for (auto& elem : t) elem.Deactivate();
|
|
3911
|
+
}
|
|
3912
|
+
#endif
|
|
3913
|
+
}
|
|
3914
|
+
|
|
3915
|
+
// TODO(b/328794765): this check is very useful to run with ASAN in opt mode.
|
|
3916
|
+
TEST(Table, DestroyedCallsFail) {
|
|
3917
|
+
#ifdef NDEBUG
|
|
3918
|
+
ASSERT_EQ(SwisstableAssertAccessToDestroyedTable(),
|
|
3919
|
+
SwisstableGenerationsEnabled());
|
|
3920
|
+
#else
|
|
3921
|
+
ASSERT_TRUE(SwisstableAssertAccessToDestroyedTable());
|
|
3922
|
+
#endif
|
|
3923
|
+
if (!SwisstableAssertAccessToDestroyedTable()) {
|
|
3924
|
+
GTEST_SKIP() << "Validation not enabled.";
|
|
3925
|
+
}
|
|
3926
|
+
#if !defined(__clang__) && defined(__GNUC__)
|
|
3927
|
+
GTEST_SKIP() << "Flaky on GCC.";
|
|
3928
|
+
#endif
|
|
3929
|
+
absl::optional<IntTable> t;
|
|
3930
|
+
t.emplace({1});
|
|
3931
|
+
IntTable* t_ptr = &*t;
|
|
3932
|
+
EXPECT_TRUE(t_ptr->contains(1));
|
|
3933
|
+
t.reset();
|
|
3934
|
+
std::string expected_death_message =
|
|
3935
|
+
#if defined(ABSL_HAVE_MEMORY_SANITIZER)
|
|
3936
|
+
"use-of-uninitialized-value";
|
|
3937
|
+
#else
|
|
3938
|
+
"destroyed hash table";
|
|
3939
|
+
#endif
|
|
3940
|
+
EXPECT_DEATH_IF_SUPPORTED(t_ptr->contains(1), expected_death_message);
|
|
3941
|
+
}
|
|
3942
|
+
|
|
3943
|
+
TEST(Table, DestroyedCallsFailDuringDestruction) {
|
|
3944
|
+
if (!SwisstableAssertAccessToDestroyedTable()) {
|
|
3945
|
+
GTEST_SKIP() << "Validation not enabled.";
|
|
3946
|
+
}
|
|
3947
|
+
#if !defined(__clang__) && defined(__GNUC__)
|
|
3948
|
+
GTEST_SKIP() << "Flaky on GCC.";
|
|
3949
|
+
#endif
|
|
3950
|
+
// When EXPECT_DEATH_IF_SUPPORTED is not executed, the code after it is not
|
|
3951
|
+
// executed as well.
|
|
3952
|
+
// We need to destruct the table correctly in such a case.
|
|
3953
|
+
// Must be defined before the table for correct destruction order.
|
|
3954
|
+
bool do_lookup = false;
|
|
3955
|
+
|
|
3956
|
+
using Table = absl::flat_hash_map<int, std::shared_ptr<int>>;
|
|
3957
|
+
absl::optional<Table> t = Table();
|
|
3958
|
+
Table* t_ptr = &*t;
|
|
3959
|
+
auto destroy = [&](int* ptr) {
|
|
3960
|
+
if (do_lookup) {
|
|
3961
|
+
ASSERT_TRUE(t_ptr->contains(*ptr));
|
|
3962
|
+
}
|
|
3963
|
+
delete ptr;
|
|
3964
|
+
};
|
|
3965
|
+
t->insert({0, std::shared_ptr<int>(new int(0), destroy)});
|
|
3966
|
+
auto destroy_with_lookup = [&] {
|
|
3967
|
+
do_lookup = true;
|
|
3968
|
+
t.reset();
|
|
3969
|
+
};
|
|
3970
|
+
std::string expected_death_message =
|
|
3971
|
+
#ifdef NDEBUG
|
|
3972
|
+
"destroyed hash table";
|
|
3973
|
+
#else
|
|
3974
|
+
"Reentrant container access";
|
|
3975
|
+
#endif
|
|
3976
|
+
EXPECT_DEATH_IF_SUPPORTED(destroy_with_lookup(), expected_death_message);
|
|
3977
|
+
}
|
|
3978
|
+
|
|
3979
|
+
TEST(Table, MovedFromCallsFail) {
|
|
3980
|
+
if (!SwisstableGenerationsEnabled()) {
|
|
3981
|
+
GTEST_SKIP() << "Moved-from checks only enabled in sanitizer mode.";
|
|
3982
|
+
return;
|
|
3983
|
+
}
|
|
3984
|
+
|
|
3985
|
+
{
|
|
3986
|
+
ABSL_ATTRIBUTE_UNUSED IntTable t1, t2, t3;
|
|
3987
|
+
t1.insert(1);
|
|
3988
|
+
t2 = std::move(t1);
|
|
3989
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
3990
|
+
EXPECT_DEATH_IF_SUPPORTED(t1.contains(1), "moved-from");
|
|
3991
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
3992
|
+
EXPECT_DEATH_IF_SUPPORTED(t1.swap(t3), "moved-from");
|
|
3993
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
3994
|
+
EXPECT_DEATH_IF_SUPPORTED(t1.merge(t3), "moved-from");
|
|
3995
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
3996
|
+
EXPECT_DEATH_IF_SUPPORTED(IntTable{t1}, "moved-from");
|
|
3997
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
3998
|
+
EXPECT_DEATH_IF_SUPPORTED(t1.begin(), "moved-from");
|
|
3999
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
4000
|
+
EXPECT_DEATH_IF_SUPPORTED(t1.end(), "moved-from");
|
|
4001
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
4002
|
+
EXPECT_DEATH_IF_SUPPORTED(t1.size(), "moved-from");
|
|
4003
|
+
}
|
|
4004
|
+
{
|
|
4005
|
+
ABSL_ATTRIBUTE_UNUSED IntTable t1;
|
|
4006
|
+
t1.insert(1);
|
|
4007
|
+
ABSL_ATTRIBUTE_UNUSED IntTable t2(std::move(t1));
|
|
4008
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
4009
|
+
EXPECT_DEATH_IF_SUPPORTED(t1.contains(1), "moved-from");
|
|
4010
|
+
t1.clear(); // Clearing a moved-from table is allowed.
|
|
4011
|
+
}
|
|
4012
|
+
{
|
|
4013
|
+
// Test that using a table (t3) that was moved-to from a moved-from table
|
|
4014
|
+
// (t1) fails.
|
|
4015
|
+
ABSL_ATTRIBUTE_UNUSED IntTable t1, t2, t3;
|
|
4016
|
+
t1.insert(1);
|
|
4017
|
+
t2 = std::move(t1);
|
|
4018
|
+
// NOLINTNEXTLINE(bugprone-use-after-move)
|
|
4019
|
+
t3 = std::move(t1);
|
|
4020
|
+
EXPECT_DEATH_IF_SUPPORTED(t3.contains(1), "moved-from");
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
|
|
4024
|
+
TEST(HashtableSize, GenerateNewSeedDoesntChangeSize) {
|
|
4025
|
+
size_t size = 1;
|
|
4026
|
+
do {
|
|
4027
|
+
HashtableSize hs(no_seed_empty_tag_t{});
|
|
4028
|
+
hs.increment_size(size);
|
|
4029
|
+
EXPECT_EQ(hs.size(), size);
|
|
4030
|
+
hs.generate_new_seed();
|
|
4031
|
+
EXPECT_EQ(hs.size(), size);
|
|
4032
|
+
size = size * 2 + 1;
|
|
4033
|
+
} while (size < MaxValidSizeFor1ByteSlot());
|
|
4034
|
+
}
|
|
4035
|
+
|
|
4036
|
+
TEST(Table, MaxValidSize) {
|
|
4037
|
+
IntTable t;
|
|
4038
|
+
EXPECT_EQ(MaxValidSize(sizeof(IntTable::value_type)), t.max_size());
|
|
4039
|
+
if constexpr (sizeof(size_t) == 8) {
|
|
4040
|
+
for (size_t i = 0; i < 35; ++i) {
|
|
4041
|
+
SCOPED_TRACE(i);
|
|
4042
|
+
size_t slot_size = size_t{1} << i;
|
|
4043
|
+
size_t max_size = MaxValidSize(slot_size);
|
|
4044
|
+
ASSERT_FALSE(IsAboveValidSize(max_size, slot_size));
|
|
4045
|
+
ASSERT_TRUE(IsAboveValidSize(max_size + 1, slot_size));
|
|
4046
|
+
ASSERT_LT(max_size, uint64_t{1} << 60);
|
|
4047
|
+
// For non gigantic slot sizes we expect max size to be at least 2^40.
|
|
4048
|
+
if (i <= 22) {
|
|
4049
|
+
ASSERT_FALSE(IsAboveValidSize(size_t{1} << 40, slot_size));
|
|
4050
|
+
ASSERT_GE(max_size, uint64_t{1} << 40);
|
|
4051
|
+
}
|
|
4052
|
+
ASSERT_LT(SizeToCapacity(max_size),
|
|
4053
|
+
uint64_t{1} << HashtableSize::kSizeBitCount);
|
|
4054
|
+
ASSERT_LT(absl::uint128(max_size) * slot_size, uint64_t{1} << 63);
|
|
4055
|
+
}
|
|
4056
|
+
}
|
|
4057
|
+
EXPECT_LT(MaxValidSize</*kSizeOfSizeT=*/4>(1), 1 << 30);
|
|
4058
|
+
EXPECT_LT(MaxValidSize</*kSizeOfSizeT=*/4>(2), 1 << 29);
|
|
4059
|
+
for (size_t i = 0; i < 29; ++i) {
|
|
4060
|
+
size_t slot_size = size_t{1} << i;
|
|
4061
|
+
size_t max_size = MaxValidSize</*kSizeOfSizeT=*/4>(slot_size);
|
|
4062
|
+
ASSERT_FALSE(IsAboveValidSize</*kSizeOfSizeT=*/4>(max_size, slot_size));
|
|
4063
|
+
ASSERT_TRUE(IsAboveValidSize</*kSizeOfSizeT=*/4>(max_size + 1, slot_size));
|
|
4064
|
+
ASSERT_LT(max_size, 1 << 30);
|
|
4065
|
+
size_t max_capacity = SizeToCapacity(max_size);
|
|
4066
|
+
ASSERT_LT(max_capacity, (size_t{1} << 31) / slot_size);
|
|
4067
|
+
ASSERT_GT(max_capacity, (1 << 29) / slot_size);
|
|
4068
|
+
ASSERT_LT(max_capacity * slot_size, size_t{1} << 31);
|
|
4069
|
+
}
|
|
4070
|
+
}
|
|
4071
|
+
|
|
4072
|
+
TEST(Table, MaxSizeOverflow) {
|
|
4073
|
+
size_t overflow = (std::numeric_limits<size_t>::max)();
|
|
4074
|
+
EXPECT_DEATH_IF_SUPPORTED(IntTable t(overflow), "Hash table size overflow");
|
|
4075
|
+
IntTable t;
|
|
4076
|
+
EXPECT_DEATH_IF_SUPPORTED(t.reserve(overflow), "Hash table size overflow");
|
|
4077
|
+
EXPECT_DEATH_IF_SUPPORTED(t.rehash(overflow), "Hash table size overflow");
|
|
4078
|
+
size_t slightly_overflow = MaxValidSize(sizeof(IntTable::value_type)) + 1;
|
|
4079
|
+
size_t slightly_overflow_capacity =
|
|
4080
|
+
NextCapacity(NormalizeCapacity(slightly_overflow));
|
|
4081
|
+
EXPECT_DEATH_IF_SUPPORTED(IntTable t2(slightly_overflow_capacity - 10),
|
|
4082
|
+
"Hash table size overflow");
|
|
4083
|
+
EXPECT_DEATH_IF_SUPPORTED(t.reserve(slightly_overflow),
|
|
4084
|
+
"Hash table size overflow");
|
|
4085
|
+
EXPECT_DEATH_IF_SUPPORTED(t.rehash(slightly_overflow),
|
|
4086
|
+
"Hash table size overflow");
|
|
4087
|
+
IntTable non_empty_table;
|
|
4088
|
+
non_empty_table.insert(0);
|
|
4089
|
+
EXPECT_DEATH_IF_SUPPORTED(non_empty_table.reserve(slightly_overflow),
|
|
4090
|
+
"Hash table size overflow");
|
|
4091
|
+
}
|
|
4092
|
+
|
|
4093
|
+
// TODO(b/397453582): Remove support for const hasher and remove this test.
|
|
4094
|
+
TEST(Table, ConstLambdaHash) {
|
|
4095
|
+
int64_t multiplier = 17;
|
|
4096
|
+
// Make sure that code compiles and work OK with non-empty hasher with const
|
|
4097
|
+
// qualifier.
|
|
4098
|
+
const auto hash = [multiplier](SizedValue<64> value) -> size_t {
|
|
4099
|
+
return static_cast<size_t>(static_cast<int64_t>(value) * multiplier);
|
|
4100
|
+
};
|
|
4101
|
+
static_assert(!std::is_empty_v<decltype(hash)>);
|
|
4102
|
+
absl::flat_hash_set<SizedValue<64>, decltype(hash)> t(0, hash);
|
|
4103
|
+
t.insert(1);
|
|
4104
|
+
EXPECT_EQ(t.size(), 1);
|
|
4105
|
+
EXPECT_EQ(t.find(1), t.begin());
|
|
4106
|
+
EXPECT_EQ(t.find(2), t.end());
|
|
4107
|
+
t.insert(2);
|
|
4108
|
+
EXPECT_EQ(t.size(), 2);
|
|
4109
|
+
EXPECT_NE(t.find(1), t.end());
|
|
4110
|
+
EXPECT_NE(t.find(2), t.end());
|
|
4111
|
+
EXPECT_EQ(t.find(3), t.end());
|
|
4112
|
+
}
|
|
4113
|
+
|
|
4114
|
+
struct ConstUint8Hash {
|
|
4115
|
+
size_t operator()(uint8_t) const { return *value; }
|
|
4116
|
+
size_t* value;
|
|
4117
|
+
};
|
|
4118
|
+
|
|
4119
|
+
// This test is imitating growth of a very big table and triggers all buffer
|
|
4120
|
+
// overflows.
|
|
4121
|
+
// We try to insert all elements into the first probe group.
|
|
4122
|
+
// So the resize codepath in test does the following:
|
|
4123
|
+
// 1. Insert 16 elements into the first probe group. No other elements will be
|
|
4124
|
+
// inserted into the first probe group.
|
|
4125
|
+
// 2. There will be enough elements to fill up the local buffer even for
|
|
4126
|
+
// encoding with 4 bytes.
|
|
4127
|
+
// 3. After local buffer is full, we will fill up the control buffer till
|
|
4128
|
+
// some point.
|
|
4129
|
+
// 4. Then a few times we will extend control buffer end.
|
|
4130
|
+
// 5. Finally we will catch up and go to overflow codepath.
|
|
4131
|
+
TEST(Table, GrowExtremelyLargeTable) {
|
|
4132
|
+
constexpr size_t kTargetCapacity =
|
|
4133
|
+
#if defined(__wasm__) || defined(__asmjs__) || defined(__i386__)
|
|
4134
|
+
NextCapacity(ProbedItem4Bytes::kMaxNewCapacity); // OOMs on WASM, 32-bit.
|
|
4135
|
+
#else
|
|
4136
|
+
NextCapacity(ProbedItem8Bytes::kMaxNewCapacity);
|
|
4137
|
+
#endif
|
|
4138
|
+
|
|
4139
|
+
size_t hash = 0;
|
|
4140
|
+
// In order to save memory we use 1 byte slot.
|
|
4141
|
+
// There are not enough different values to achieve big capacity, so we
|
|
4142
|
+
// artificially update growth info to force resize.
|
|
4143
|
+
absl::flat_hash_set<uint8_t, ConstUint8Hash> t(63, ConstUint8Hash{&hash});
|
|
4144
|
+
CommonFields& common = RawHashSetTestOnlyAccess::GetCommon(t);
|
|
4145
|
+
// Set 0 seed so that H1 is always 0.
|
|
4146
|
+
common.set_no_seed_for_testing();
|
|
4147
|
+
ASSERT_EQ(H1(t.hash_function()(75)), 0);
|
|
4148
|
+
uint8_t inserted_till = 210;
|
|
4149
|
+
for (uint8_t i = 0; i < inserted_till; ++i) {
|
|
4150
|
+
t.insert(i);
|
|
4151
|
+
}
|
|
4152
|
+
for (uint8_t i = 0; i < inserted_till; ++i) {
|
|
4153
|
+
ASSERT_TRUE(t.contains(i));
|
|
4154
|
+
}
|
|
4155
|
+
|
|
4156
|
+
for (size_t cap = t.capacity(); cap < kTargetCapacity;
|
|
4157
|
+
cap = NextCapacity(cap)) {
|
|
4158
|
+
ASSERT_EQ(t.capacity(), cap);
|
|
4159
|
+
// Update growth info to force resize on the next insert.
|
|
4160
|
+
common.growth_info().OverwriteManyEmptyAsFull(CapacityToGrowth(cap) -
|
|
4161
|
+
t.size());
|
|
4162
|
+
t.insert(inserted_till++);
|
|
4163
|
+
ASSERT_EQ(t.capacity(), NextCapacity(cap));
|
|
4164
|
+
for (uint8_t i = 0; i < inserted_till; ++i) {
|
|
4165
|
+
ASSERT_TRUE(t.contains(i));
|
|
4166
|
+
}
|
|
4167
|
+
}
|
|
4168
|
+
EXPECT_EQ(t.capacity(), kTargetCapacity);
|
|
4169
|
+
}
|
|
4170
|
+
|
|
4171
|
+
// Test that after calling generate_new_seed(), the high bits of the returned
|
|
4172
|
+
// seed are non-zero.
|
|
4173
|
+
TEST(PerTableSeed, HighBitsAreNonZero) {
|
|
4174
|
+
HashtableSize hs(no_seed_empty_tag_t{});
|
|
4175
|
+
for (int i = 0; i < 100; ++i) {
|
|
4176
|
+
hs.generate_new_seed();
|
|
4177
|
+
ASSERT_GT(hs.seed().seed() >> 16, 0);
|
|
4178
|
+
}
|
|
4179
|
+
}
|
|
4180
|
+
|
|
4181
|
+
} // namespace
|
|
4182
|
+
} // namespace container_internal
|
|
4183
|
+
ABSL_NAMESPACE_END
|
|
4184
|
+
} // namespace absl
|