From b03e4d38f1679e7100d53928407b4d2d8e87f523 Mon Sep 17 00:00:00 2001 From: stdpain Date: Mon, 20 Jun 2022 19:45:17 +0800 Subject: [PATCH] Implement HashtableDebugAccess for parallel_hash_set --- parallel_hashmap/phmap.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index 6ba25bc..1803bdf 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -4387,6 +4387,21 @@ namespace hashtable_debug_internal { // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- + +template +struct HashtableDebugAccess> { + using Traits = typename Set::PolicyTraits; + using Slot = typename Traits::slot_type; + using EmbeddedSet = typename Set::EmbeddedSet; + + static size_t GetNumProbes(const Set& set, const typename Set::key_type& key) { + size_t hashval = set.hash(key); + auto& inner = set.sets_[set.subidx(hashval)]; + auto& inner_set = inner.set_; + return HashtableDebugAccess::GetNumProbes(inner_set, key); + } +}; + template struct HashtableDebugAccess> {