{
uint64_t nEpoch = m_nCurEpoch.load( atomics::memory_order_relaxed );
while ( itFirst != itLast ) {
- push_buffer( epoch_retired_ptr( *itFirst, nEpoch ));
+ epoch_retired_ptr ep( *itFirst, nEpoch );
++itFirst;
+ push_buffer( std::move(ep) );
}
}
void batch_retire( Func e )
{
uint64_t nEpoch = m_nCurEpoch.load( atomics::memory_order_relaxed );
- for ( retired_ptr p{ e() }; p.m_p; p = e() )
- push_buffer( epoch_retired_ptr( p, nEpoch ));
+ for ( retired_ptr p{ e() }; p.m_p; ) {
+ epoch_retired_ptr ep( p, nEpoch );
+ p = e();
+ push_buffer( std::move(ep));
+ }
}
/// Wait to finish a grace period and then clear the buffer
retired_ptr p{ e() };
if ( p.m_p ) {
synchronize();
- for ( ; p.m_p; p = e() )
- p.free();
+ while ( p.m_p ) {
+ retired_ptr pr( p );
+ p = e();
+ pr.free();
+ }
}
}
{
uint64_t nEpoch = m_nCurEpoch.load( atomics::memory_order_relaxed );
while ( itFirst != itLast ) {
- push_buffer( epoch_retired_ptr( *itFirst, nEpoch ));
+ epoch_retired_ptr ep( *itFirst, nEpoch );
++itFirst;
+ push_buffer( std::move(ep));
}
}
void batch_retire( Func e )
{
uint64_t nEpoch = m_nCurEpoch.load( atomics::memory_order_relaxed );
- for ( retired_ptr p{ e() }; p.m_p; p = e() )
- push_buffer( epoch_retired_ptr( p, nEpoch ));
+ for ( retired_ptr p{ e() }; p.m_p; ) {
+ epoch_retired_ptr ep( p, nEpoch );
+ p = e();
+ push_buffer( std::move(ep));
+ }
}
{
uint64_t nEpoch = m_nCurEpoch.load( atomics::memory_order_relaxed );
while ( itFirst != itLast ) {
- push_buffer( epoch_retired_ptr( *itFirst, nEpoch ));
+ epoch_retired_ptr ep( *itFirst, nEpoch );
++itFirst;
+ push_buffer( std::move(ep));
}
}
void batch_retire( Func e )
{
uint64_t nEpoch = m_nCurEpoch.load( atomics::memory_order_relaxed );
- for ( retired_ptr p{ e() }; p.m_p; p = e() )
- push_buffer( epoch_retired_ptr( p, nEpoch ));
+ for ( retired_ptr p{ e() }; p.m_p; ) {
+ epoch_retired_ptr ep( p, nEpoch );
+ p = e();
+ push_buffer( std::move(ep));
+ }
}
/// Wait to finish a grace period and then clear the buffer
{
uint64_t nEpoch = m_nCurEpoch.load( atomics::memory_order_relaxed );
while ( itFirst != itLast ) {
- push_buffer( epoch_retired_ptr( *itFirst, nEpoch ) );
+ epoch_retired_ptr ep( *itFirst, nEpoch );
++itFirst;
+ push_buffer( std::move(ep));
}
}
void batch_retire( Func e )
{
uint64_t nEpoch = m_nCurEpoch.load( atomics::memory_order_relaxed );
- for ( retired_ptr p{ e() }; p.m_p; p = e() )
- push_buffer( epoch_retired_ptr( p, nEpoch ));
+ for ( retired_ptr p{ e() }; p.m_p; ) {
+ epoch_retired_ptr ep( p, nEpoch );
+ p = e();
+ push_buffer( std::move(ep));
+ }
}