From e21e321bcfb6ad99e0c97d58cdd5b39113827488 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Sat, 30 Sep 2023 09:43:19 +0200 Subject: [PATCH] reverted "added bulk_visit2" --- .../boost/unordered/concurrent_flat_map.hpp | 8 -------- .../unordered/detail/foa/concurrent_table.hpp | 19 ++++++++++--------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/include/boost/unordered/concurrent_flat_map.hpp b/include/boost/unordered/concurrent_flat_map.hpp index 0318535d..2f1bd43c 100644 --- a/include/boost/unordered/concurrent_flat_map.hpp +++ b/include/boost/unordered/concurrent_flat_map.hpp @@ -252,14 +252,6 @@ namespace boost { return table_.bulk_visit(keys, f); } - template - BOOST_FORCEINLINE - std::size_t bulk_visit2(const std::array& keys,F f)const - { - BOOST_UNORDERED_STATIC_ASSERT_CONST_INVOCABLE(F) - return table_.bulk_visit2(keys, f); - } - template BOOST_FORCEINLINE typename std::enable_if< detail::are_transparent::value, size_type>::type diff --git a/include/boost/unordered/detail/foa/concurrent_table.hpp b/include/boost/unordered/detail/foa/concurrent_table.hpp index 34b0e6dc..82c4e136 100644 --- a/include/boost/unordered/detail/foa/concurrent_table.hpp +++ b/include/boost/unordered/detail/foa/concurrent_table.hpp @@ -565,6 +565,7 @@ public: return visit(x,std::forward(f)); } +#if 1 template BOOST_FORCEINLINE std::size_t bulk_visit(const std::array& keys,F&& f)const @@ -634,30 +635,30 @@ public: } return res; } - +#else template BOOST_FORCEINLINE - std::size_t bulk_visit2(const std::array& keys,F&& f)const + std::size_t bulk_visit(const std::array& keys,F&& f)const { auto lck=shared_access(); std::size_t res=0, - hashes[M], - positions[M]; + hashes[M]; for(std::size_t i=0;ihash_for(keys[i]); - auto pos=positions[i]=this->position_for(hashes[i]); - BOOST_UNORDERED_PREFETCH(this->arrays.groups()+pos); - BOOST_UNORDERED_PREFETCH(this->arrays.group_accesses()+pos); - BOOST_UNORDERED_PREFETCH_ELEMENTS(this->arrays.elements()+pos*N,N); + auto pos=this->position_for(hashes[i]); + BOOST_UNORDERED_PREFETCH(this->arrays.groups+pos); + BOOST_UNORDERED_PREFETCH(this->arrays.group_accesses+pos); + BOOST_UNORDERED_PREFETCH_ELEMENTS(this->arrays.elements+pos*N,N); } for(std::size_t i=0;iposition_for(hashes[i]),hashes[i], std::forward(f)); } return res; } +#endif template std::size_t visit_all(F&& f) {