From 1c6cafcd0b9e87a1f36d1eba0eff5ad2608d6c8c Mon Sep 17 00:00:00 2001 From: khizmax Date: Sat, 4 Oct 2014 23:23:12 +0400 Subject: [PATCH] replace struct internal_disposer with lambda --- cds/intrusive/msqueue.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/cds/intrusive/msqueue.h b/cds/intrusive/msqueue.h index 8d6e0b05..ee83e544 100644 --- a/cds/intrusive/msqueue.h +++ b/cds/intrusive/msqueue.h @@ -341,17 +341,6 @@ namespace cds { namespace intrusive { // GC and node_type::gc must be the same static_assert((std::is_same::value), "GC and node_type::gc must be the same"); - struct internal_disposer - { - void operator()( value_type * p ) - { - assert( p != nullptr ); - - MSQueue::clear_links( node_traits::to_node_ptr(p) ); - disposer()( p ); - } - }; - typedef intrusive::node_to_value node_to_value; typedef typename opt::details::alignment_setter< typename node_type::atomic_node_ptr, traits::alignment >::type aligned_node_ptr; @@ -430,7 +419,13 @@ namespace cds { namespace intrusive { // before HP retiring cycle invocation. // So, we will never clear m_Dummy if ( p != &m_Dummy ) { - gc::template retire( node_traits::to_value_ptr(p) ); + gc::retire( node_traits::to_value_ptr(p), + []( value_type * ptr ) { + assert( ptr != nullptr ); + MSQueue::clear_links( node_traits::to_node_ptr( ptr ) ); + disposer()(ptr); + } + ); } } //@endcond -- 2.34.1