From c36bb4f41572e4b6eb6173d3b62ee216f4ec373c Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 23 Mar 2015 09:07:48 +0300 Subject: [PATCH] Removed research code from BronsonAVLTreeMap --- cds/container/details/bronson_avltree_base.h | 3 --- cds/container/impl/bronson_avltree_map_rcu.h | 12 ++++-------- tests/unit/print_bronsonavltree_stat.h | 1 - 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/cds/container/details/bronson_avltree_base.h b/cds/container/details/bronson_avltree_base.h index 289b1793..2b4839b6 100644 --- a/cds/container/details/bronson_avltree_base.h +++ b/cds/container/details/bronson_avltree_base.h @@ -168,7 +168,6 @@ namespace cds { namespace container { event_counter m_nFindSuccess; ///< Count of success \p find() call event_counter m_nFindFailed; ///< Count of failed \p find() call event_counter m_nFindRetry; ///< Count of retries during \p find() - event_counter m_nFindNotFoundRetry; ///< Count of ??? event_counter m_nFindWaitShrinking; ///< Count of waiting until shrinking completed duting \p find() call event_counter m_nInsertSuccess; ///< Count of inserting data node @@ -198,7 +197,6 @@ namespace cds { namespace container { void onFindSuccess() { ++m_nFindSuccess ; } void onFindFailed() { ++m_nFindFailed ; } void onFindRetry() { ++m_nFindRetry ; } - void onFindNotFoundRetry() { ++m_nFindNotFoundRetry; } void onFindWaitShrinking() { ++m_nFindWaitShrinking; } void onInsertSuccess() { ++m_nInsertSuccess ; } @@ -232,7 +230,6 @@ namespace cds { namespace container { void onFindSuccess() const {} void onFindFailed() const {} void onFindRetry() const {} - void onFindNotFoundRetry() const {} void onFindWaitShrinking() const {} void onInsertSuccess() const {} diff --git a/cds/container/impl/bronson_avltree_map_rcu.h b/cds/container/impl/bronson_avltree_map_rcu.h index 905c27e5..beecde36 100644 --- a/cds/container/impl/bronson_avltree_map_rcu.h +++ b/cds/container/impl/bronson_avltree_map_rcu.h @@ -975,14 +975,8 @@ namespace cds { namespace container { } find_result found = try_find( key, cmp, f, pChild, nCmp, nChildVersion ); - if ( found != find_result::retry ) { - if ( found == find_result::not_found && child(pNode, nDir) != pChild ) { - // Oops! That is a bug!!! - m_stat.onFindNotFoundRetry(); - } - else - return found; - } + if ( found != find_result::retry ) + return found; } if ( pNode->version( memory_model::memory_order_acquire ) != nVersion ) { @@ -1657,6 +1651,8 @@ namespace cds { namespace container { static void begin_change( node_type * pNode, version_type version ) { + assert(pNode->version(memory_model::memory_order_acquire) == version ); + assert( (version & node_type::shrinking) == 0 ); pNode->version( version | node_type::shrinking, memory_model::memory_order_release ); } static void end_change( node_type * pNode, version_type version ) diff --git a/tests/unit/print_bronsonavltree_stat.h b/tests/unit/print_bronsonavltree_stat.h index 248f3fd1..f237a283 100644 --- a/tests/unit/print_bronsonavltree_stat.h +++ b/tests/unit/print_bronsonavltree_stat.h @@ -18,7 +18,6 @@ namespace std { << "\t\t m_nFindSuccess: " << s.m_nFindSuccess.get() << "\n" << "\t\t m_nFindFailed: " << s.m_nFindFailed.get() << "\n" << "\t\t m_nFindRetry: " << s.m_nFindRetry.get() << "\n" - << "\t\t m_nFindNotFoundRetry: " << s.m_nFindNotFoundRetry.get() << "\n" << "\t\t m_nFindWaitShrinking: " << s.m_nFindWaitShrinking.get() << "\n" << "\t\t m_nInsertSuccess: " << s.m_nInsertSuccess.get() << "\n" << "\t\t m_nRelaxedInsertFailed: " << s.m_nRelaxedInsertFailed.get() << "\n" -- 2.34.1