From 88352a83b37f151495efb88ac3c42f0061dc1936 Mon Sep 17 00:00:00 2001 From: Martin Leitner-Ankerl Date: Sat, 5 Oct 2024 07:24:49 +0200 Subject: [PATCH] update all dependencies, add file for reentrant test --- include/ankerl/unordered_dense.h | 9 +-- subprojects/abseil-cpp.wrap | 101 ++++++++++++++++++++++++++++--- subprojects/doctest.wrap | 11 ++-- subprojects/fmt.wrap | 17 +++--- test/meson.build | 1 + test/unit/diamond.cpp | 1 - test/unit/reentrant.cpp | 35 +++++++++++ 7 files changed, 149 insertions(+), 26 deletions(-) create mode 100644 test/unit/reentrant.cpp diff --git a/include/ankerl/unordered_dense.h b/include/ankerl/unordered_dense.h index 2aaacd61..a1028acf 100644 --- a/include/ankerl/unordered_dense.h +++ b/include/ankerl/unordered_dense.h @@ -271,8 +271,8 @@ inline void mum(uint64_t* a, uint64_t* b) { ANKERL_UNORDERED_DENSE_EXPORT template struct hash { - auto operator()(T const& obj) const noexcept(noexcept(std::declval>().operator()(std::declval()))) - -> uint64_t { + auto operator()(T const& obj) const + noexcept(noexcept(std::declval>().operator()(std::declval()))) -> uint64_t { return std::hash{}(obj); } }; @@ -1073,8 +1073,9 @@ class table : public std::conditional_t, base_table_type_map, bas } template - auto do_place_element(dist_and_fingerprint_type dist_and_fingerprint, value_idx_type bucket_idx, Args&&... args) - -> std::pair { + auto do_place_element(dist_and_fingerprint_type dist_and_fingerprint, + value_idx_type bucket_idx, + Args&&... args) -> std::pair { // emplace the new value. If that throws an exception, no harm done; index is still in a valid state m_values.emplace_back(std::forward(args)...); diff --git a/subprojects/abseil-cpp.wrap b/subprojects/abseil-cpp.wrap index 29ad8c2e..9a8e0727 100644 --- a/subprojects/abseil-cpp.wrap +++ b/subprojects/abseil-cpp.wrap @@ -1,23 +1,108 @@ [wrap-file] -directory = abseil-cpp-20220623.0 -source_url = https://github.com/abseil/abseil-cpp/archive/20220623.0.tar.gz -source_filename = abseil-cpp-20220623.0.tar.gz -source_hash = 4208129b49006089ba1d6710845a45e31c59b0ab6bff9e5788a87f55c5abd602 -patch_filename = abseil-cpp_20220623.0-2_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/abseil-cpp_20220623.0-2/get_patch -patch_hash = d19cb16610d9310658a815ebcd87a9e2966aafbd57964341c0d1a3a3778c03b6 -wrapdb_version = 20220623.0-2 +directory = abseil-cpp-20240722.0 +source_url = https://github.com/abseil/abseil-cpp/releases/download/20240722.0/abseil-cpp-20240722.0.tar.gz +source_filename = abseil-cpp-20240722.0.tar.gz +source_hash = f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3 +patch_filename = abseil-cpp_20240722.0-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/abseil-cpp_20240722.0-1/get_patch +patch_hash = 692bbbc39cacaba4dc4b0c8b2fbbe32736c9cde6377acfa0d52088797af14ded +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/abseil-cpp_20240722.0-1/abseil-cpp-20240722.0.tar.gz +wrapdb_version = 20240722.0-1 [provide] absl_base = absl_base_dep absl_container = absl_container_dep absl_debugging = absl_debugging_dep +absl_log = absl_log_dep absl_flags = absl_flags_dep absl_hash = absl_hash_dep +absl_crc = absl_crc_dep absl_numeric = absl_numeric_dep +absl_profiling = absl_profiling_dep absl_random = absl_random_dep absl_status = absl_status_dep absl_strings = absl_strings_dep absl_synchronization = absl_synchronization_dep absl_time = absl_time_dep absl_types = absl_types_dep +absl_algorithm_container = absl_base_dep +absl_any_invocable = absl_base_dep +absl_bad_any_cast_impl = absl_types_dep +absl_bad_optional_access = absl_types_dep +absl_bad_variant_access = absl_types_dep +absl_bind_front = absl_base_dep +absl_city = absl_hash_dep +absl_civil_time = absl_time_dep +absl_cleanup = absl_base_dep +absl_cord = absl_strings_dep +absl_cord_internal = absl_strings_dep +absl_cordz_functions = absl_strings_dep +absl_cordz_handle = absl_strings_dep +absl_cordz_info = absl_strings_dep +absl_cordz_sample_token = absl_strings_dep +absl_core_headers = absl_base_dep +absl_crc32c = absl_crc_dep +absl_debugging_internal = absl_debugging_dep +absl_demangle_internal = absl_debugging_dep +absl_die_if_null = absl_log_dep +absl_examine_stack = absl_debugging_dep +absl_exponential_biased = absl_profiling_dep +absl_failure_signal_handler = absl_debugging_dep +absl_flags_commandlineflag = absl_flags_dep +absl_flags_commandlineflag_internal = absl_flags_dep +absl_flags_config = absl_flags_dep +absl_flags_internal = absl_flags_dep +absl_flags_marshalling = absl_flags_dep +absl_flags_parse = absl_flags_dep +absl_flags_private_handle_accessor = absl_flags_dep +absl_flags_program_name = absl_flags_dep +absl_flags_reflection = absl_flags_dep +absl_flags_usage = absl_flags_dep +absl_flags_usage_internal = absl_flags_dep +absl_flat_hash_map = absl_container_dep +absl_flat_hash_set = absl_container_dep +absl_function_ref = absl_base_dep +absl_graphcycles_internal = absl_synchronization_dep +absl_hashtablez_sampler = absl_container_dep +absl_inlined_vector = absl_container_dep +absl_int128 = absl_numeric_dep +absl_leak_check = absl_debugging_dep +absl_log_initialize = absl_log_dep +absl_log_internal_check_op = absl_log_dep +absl_log_internal_message = absl_log_dep +absl_log_severity = absl_base_dep +absl_low_level_hash = absl_hash_dep +absl_memory = absl_base_dep +absl_optional = absl_types_dep +absl_periodic_sampler = absl_profiling_dep +absl_random_bit_gen_ref = absl_random_dep +absl_random_distributions = absl_random_dep +absl_random_internal_distribution_test_util = absl_random_dep +absl_random_internal_platform = absl_random_dep +absl_random_internal_pool_urbg = absl_random_dep +absl_random_internal_randen = absl_random_dep +absl_random_internal_randen_hwaes = absl_random_dep +absl_random_internal_randen_hwaes_impl = absl_random_dep +absl_random_internal_randen_slow = absl_random_dep +absl_random_internal_seed_material = absl_random_dep +absl_random_random = absl_random_dep +absl_random_seed_gen_exception = absl_random_dep +absl_random_seed_sequences = absl_random_dep +absl_raw_hash_set = absl_container_dep +absl_raw_logging_internal = absl_base_dep +absl_scoped_set_env = absl_base_dep +absl_span = absl_types_dep +absl_spinlock_wait = absl_base_dep +absl_stacktrace = absl_debugging_dep +absl_statusor = absl_status_dep +absl_str_format = absl_strings_dep +absl_str_format_internal = absl_strings_dep +absl_strerror = absl_base_dep +absl_string_view = absl_strings_dep +absl_strings_internal = absl_strings_dep +absl_symbolize = absl_debugging_dep +absl_throw_delegate = absl_base_dep +absl_time_zone = absl_time_dep +absl_type_traits = absl_base_dep +absl_utility = absl_base_dep +absl_variant = absl_types_dep diff --git a/subprojects/doctest.wrap b/subprojects/doctest.wrap index 88fa2879..f9a150f7 100644 --- a/subprojects/doctest.wrap +++ b/subprojects/doctest.wrap @@ -1,9 +1,10 @@ [wrap-file] -directory = doctest-2.4.9 -source_url = https://github.com/doctest/doctest/archive/refs/tags/v2.4.9.tar.gz -source_filename = doctest-2.4.9.tar.gz -source_hash = 19b2df757f2f3703a5e63cee553d85596875f06d91a3333acd80a969ef210856 -wrapdb_version = 2.4.9-1 +directory = doctest-2.4.11 +source_url = https://github.com/doctest/doctest/archive/refs/tags/v2.4.11.tar.gz +source_filename = doctest-2.4.11.tar.gz +source_hash = 632ed2c05a7f53fa961381497bf8069093f0d6628c5f26286161fbd32a560186 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/doctest_2.4.11-1/doctest-2.4.11.tar.gz +wrapdb_version = 2.4.11-1 [provide] dependency_names = doctest diff --git a/subprojects/fmt.wrap b/subprojects/fmt.wrap index 0ea7eb38..fd508477 100644 --- a/subprojects/fmt.wrap +++ b/subprojects/fmt.wrap @@ -1,12 +1,13 @@ [wrap-file] -directory = fmt-9.1.0 -source_url = https://github.com/fmtlib/fmt/archive/9.1.0.tar.gz -source_filename = fmt-9.1.0.tar.gz -source_hash = 5dea48d1fcddc3ec571ce2058e13910a0d4a6bab4cc09a809d8b1dd1c88ae6f2 -patch_filename = fmt_9.1.0-1_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/fmt_9.1.0-1/get_patch -patch_hash = 4557b9ba87b3eb63694ed9b21d1a2117d4a97ca56b91085b10288e9a5294adf8 -wrapdb_version = 9.1.0-1 +directory = fmt-11.0.2 +source_url = https://github.com/fmtlib/fmt/archive/11.0.2.tar.gz +source_filename = fmt-11.0.2.tar.gz +source_hash = 6cb1e6d37bdcb756dbbe59be438790db409cdb4868c66e888d5df9f13f7c027f +patch_filename = fmt_11.0.2-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/fmt_11.0.2-1/get_patch +patch_hash = 90c9e3b8e8f29713d40ca949f6f93ad115d78d7fb921064112bc6179e6427c5e +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_11.0.2-1/fmt-11.0.2.tar.gz +wrapdb_version = 11.0.2-1 [provide] fmt = fmt_dep diff --git a/test/meson.build b/test/meson.build index d384e68a..302b7362 100644 --- a/test/meson.build +++ b/test/meson.build @@ -62,6 +62,7 @@ test_sources = [ 'unit/not_moveable.cpp', 'unit/pmr_move_with_allocators.cpp', 'unit/pmr.cpp', + 'unit/reentrant.cpp', 'unit/rehash.cpp', 'unit/replace.cpp', 'unit/reserve_and_assign.cpp', diff --git a/test/unit/diamond.cpp b/test/unit/diamond.cpp index b3e07e0a..66a68775 100644 --- a/test/unit/diamond.cpp +++ b/test/unit/diamond.cpp @@ -3,7 +3,6 @@ #include #include // for size_t -#include // for vector // struct that provides both hash and equals operator struct hash_with_equal { diff --git a/test/unit/reentrant.cpp b/test/unit/reentrant.cpp new file mode 100644 index 00000000..70bf038a --- /dev/null +++ b/test/unit/reentrant.cpp @@ -0,0 +1,35 @@ +#include + +#include +#include + +TEST_CASE_MAP("reentrant_destruct", counter::obj, counter::obj) { + auto counts = counter{}; + INFO(counts); + + auto container = typename map_t::value_container_type{}; + + // TODO + + for (size_t i = 0; i < 100; ++i) { + container.emplace_back(counter::obj{i, counts}, counter::obj{i, counts}); + container.emplace_back(counter::obj{i, counts}, counter::obj{i, counts}); + } + + for (size_t i = 0; i < 10; ++i) { + container.emplace_back(counter::obj{i, counts}, counter::obj{i, counts}); + } + + // add some elements + auto map = map_t(); + for (size_t i = 0; i < 10; ++i) { + map.try_emplace(counter::obj{i, counts}, counter::obj{i, counts}); + } + + map.replace(std::move(container)); + + REQUIRE(map.size() == 100U); + for (size_t i = 0; i < 100; ++i) { + REQUIRE(map.contains(counter::obj{i, counts})); + } +}