/// 64bit
uint64_t operator()( uint64_t x ) const
{
- return ( static_cast<uint64_t>( operator()( static_cast<uint32_t>( x )) ) << 32 ) // low 32bit
- | ( static_cast<uint64_t>( operator()( static_cast<uint32_t>( x >> 32 )) )); // high 32bit
+ return ( static_cast<uint64_t>( operator()( static_cast<uint32_t>( x ))) << 32 ) // low 32bit
+ | ( static_cast<uint64_t>( operator()( static_cast<uint32_t>( x >> 32 )))); // high 32bit
}
};
/// 64bit
uint64_t operator()( uint64_t x ) const
{
- return ( static_cast<uint64_t>( operator()( static_cast<uint32_t>( x )) ) << 32 ) |
- static_cast<uint64_t>( operator()( static_cast<uint32_t>( x >> 32 )) );
+ return ( static_cast<uint64_t>( operator()( static_cast<uint32_t>( x ))) << 32 ) |
+ static_cast<uint64_t>( operator()( static_cast<uint32_t>( x >> 32 )));
}
};
// for 32bit architecture
static uint32_t muldiv32( uint32_t x )
{
- return static_cast<uint32_t>( muldiv32_byte( static_cast<uint8_t>( x >> 24 )) )
- | ( static_cast<uint32_t>( muldiv32_byte( static_cast<uint8_t>( x >> 16 )) ) << 8 )
- | ( static_cast<uint32_t>( muldiv32_byte( static_cast<uint8_t>( x >> 8 )) ) << 16 )
- | ( static_cast<uint32_t>( muldiv32_byte( static_cast<uint8_t>( x )) ) << 24 );
+ return static_cast<uint32_t>( muldiv32_byte( static_cast<uint8_t>( x >> 24 )))
+ | ( static_cast<uint32_t>( muldiv32_byte( static_cast<uint8_t>( x >> 16 ))) << 8 )
+ | ( static_cast<uint32_t>( muldiv32_byte( static_cast<uint8_t>( x >> 8 ))) << 16 )
+ | ( static_cast<uint32_t>( muldiv32_byte( static_cast<uint8_t>( x ))) << 24 );
}
static uint64_t muldiv32( uint64_t x )
{
- return static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 56 )) )
- | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 48 )) ) << 8 )
- | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 40 )) ) << 16 )
- | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 32 )) ) << 24 )
- | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 24 )) ) << 32 )
- | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 16 )) ) << 40 )
- | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 8 )) ) << 48 )
- | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x )) ) << 56 );
+ return static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 56 )))
+ | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 48 ))) << 8 )
+ | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 40 ))) << 16 )
+ | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 32 ))) << 24 )
+ | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 24 ))) << 32 )
+ | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 16 ))) << 40 )
+ | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x >> 8 ))) << 48 )
+ | ( static_cast<uint64_t>( muldiv32_byte( static_cast<uint8_t>( x ))) << 56 );
}
/// for 64bit architectire
static uint32_t muldiv64( uint32_t x )
{
- return static_cast<uint32_t>( muldiv64_byte( static_cast<uint8_t>( x >> 24 )) )
- | ( static_cast<uint32_t>( muldiv64_byte( static_cast<uint8_t>( x >> 16 )) ) << 8 )
- | ( static_cast<uint32_t>( muldiv64_byte( static_cast<uint8_t>( x >> 8 )) ) << 16 )
- | ( static_cast<uint32_t>( muldiv64_byte( static_cast<uint8_t>( x )) ) << 24 );
+ return static_cast<uint32_t>( muldiv64_byte( static_cast<uint8_t>( x >> 24 )))
+ | ( static_cast<uint32_t>( muldiv64_byte( static_cast<uint8_t>( x >> 16 ))) << 8 )
+ | ( static_cast<uint32_t>( muldiv64_byte( static_cast<uint8_t>( x >> 8 ))) << 16 )
+ | ( static_cast<uint32_t>( muldiv64_byte( static_cast<uint8_t>( x ))) << 24 );
}
static uint64_t muldiv64( uint64_t x )
{
- return static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 56 )) )
- | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 48 )) ) << 8 )
- | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 40 )) ) << 16 )
- | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 32 )) ) << 24 )
- | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 24 )) ) << 32 )
- | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 16 )) ) << 40 )
- | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 8 )) ) << 48 )
- | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x )) ) << 56 );
+ return static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 56 )))
+ | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 48 ))) << 8 )
+ | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 40 ))) << 16 )
+ | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 32 ))) << 24 )
+ | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 24 ))) << 32 )
+ | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 16 ))) << 40 )
+ | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x >> 8 ))) << 48 )
+ | ( static_cast<uint64_t>( muldiv64_byte( static_cast<uint8_t>( x ))) << 56 );
}
//@endcond
int hLRL = height_null( child( pLRight, left_child, memory_model::memory_order_relaxed ), memory_model::memory_order_acquire );
int balance = hLL - hLRL;
- if ( balance >= -1 && balance <= 1 && !( ( hLL == 0 || hLRL == 0 ) && !pLeft->is_valued( memory_model::memory_order_relaxed )) ) {
+ if ( balance >= -1 && balance <= 1 && !( ( hLL == 0 || hLRL == 0 ) && !pLeft->is_valued( memory_model::memory_order_relaxed ))) {
// nParent.child.left won't be damaged after a double rotation
return rotate_right_over_left_locked( pParent, pNode, pLeft, hR, hLL, pLRight, hLRL );
}
node_type * pRLRight = child( pRLeft, right_child, memory_model::memory_order_relaxed );
int hRLR = height_null( pRLRight, memory_model::memory_order_acquire );
int balance = hRR - hRLR;
- if ( balance >= -1 && balance <= 1 && !( ( hRR == 0 || hRLR == 0 ) && !pRight->is_valued( memory_model::memory_order_relaxed )) )
+ if ( balance >= -1 && balance <= 1 && !( ( hRR == 0 || hRLR == 0 ) && !pRight->is_valued( memory_model::memory_order_relaxed )))
return rotate_left_over_right_locked( pParent, pNode, hL, pRight, pRLeft, hRR, hRLR );
}
@note Internally, %DHP depends on free-list implementation. There are
DCAS-based free-list \p cds::intrusive::TaggedFreeList and more complicated CAS-based free-list
- \p cds::intrusive::FreeList. For x86 architecture and GCC/clang, libcds selects appropriate free-list
+ \p cds::intrusive::FreeList. For x86 architecture and GCC/clang, libcds selects appropriate free-list
based on \p -mcx16 compiler flag. You may manually disable DCAS support specifying
\p -DCDS_DISABLE_128BIT_ATOMIC for 64bit build or \p -DCDS_DISABLE_64BIT_ATOMIC for 32bit build
in compiler command line. All your projects and libcds MUST be compiled with the same flags -
static void retire( T * p, void (* func)(void *))
{
dhp::thread_data* rec = dhp::smr::tls();
- if ( !rec->retired_.push( dhp::retired_ptr( p, func )) )
+ if ( !rec->retired_.push( dhp::retired_ptr( p, func )))
dhp::smr::instance().scan( rec );
}
CDS_EXPORT_API retired_allocator::~retired_allocator()
{
- while ( retired_block* rb = static_cast<retired_block*>( free_list_.get()) ) {
+ while ( retired_block* rb = static_cast<retired_block*>( free_list_.get())) {
rb->~retired_block();
s_free_memory( rb );
}
}
INSTANTIATE_TEST_CASE_P( a, Map_Del3_LF, ::testing::ValuesIn( Map_Del3_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Map_Del3_LF, ::testing::ValuesIn( Map_Del3_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Map_Del3_LF, ::testing::ValuesIn( Map_Del3_LF::get_load_factors()));
#endif
} // namespace map
}
INSTANTIATE_TEST_CASE_P( a, Map_DelOdd_LF, ::testing::ValuesIn( Map_DelOdd_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Map_DelOdd_LF, ::testing::ValuesIn( Map_DelOdd_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Map_DelOdd_LF, ::testing::ValuesIn( Map_DelOdd_LF::get_load_factors()));
#endif
} // namespace map
}
INSTANTIATE_TEST_CASE_P( a, Map_find_string_LF, ::testing::ValuesIn( Map_find_string::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Map_find_string_LF, ::testing::ValuesIn( Map_find_string::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Map_find_string_LF, ::testing::ValuesIn( Map_find_string::get_load_factors()));
#endif
}
INSTANTIATE_TEST_CASE_P( a, Map_InsDel_func_LF, ::testing::ValuesIn( Map_InsDel_func_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Map_InsDel_func_LF, ::testing::ValuesIn( Map_InsDel_func_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Map_InsDel_func_LF, ::testing::ValuesIn( Map_InsDel_func_LF::get_load_factors()));
#endif
} // namespace map
}
INSTANTIATE_TEST_CASE_P( a, Map_InsDel_item_int_LF, ::testing::ValuesIn( Map_InsDel_item_int_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Map_InsDel_item_int_LF, ::testing::ValuesIn( Map_InsDel_item_int_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Map_InsDel_item_int_LF, ::testing::ValuesIn( Map_InsDel_item_int_LF::get_load_factors()));
#endif
} // namespace map
}
INSTANTIATE_TEST_CASE_P( a, Map_InsDel_string_LF, ::testing::ValuesIn( Map_InsDel_string::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Map_InsDel_string_LF, ::testing::ValuesIn( Map_InsDel_string::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Map_InsDel_string_LF, ::testing::ValuesIn( Map_InsDel_string::get_load_factors()));
#endif
} // namespace map
}
INSTANTIATE_TEST_CASE_P( a, Map_InsDelFind_LF, ::testing::ValuesIn( Map_InsDelFind_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Map_InsDelFind_LF, ::testing::ValuesIn( Map_InsDelFind_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Map_InsDelFind_LF, ::testing::ValuesIn( Map_InsDelFind_LF::get_load_factors()));
#endif
} // namespace map
}
INSTANTIATE_TEST_CASE_P( a, Map_Iter_Del3_LF, ::testing::ValuesIn( Map_Iter_Del3_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Map_Iter_Del3_LF, ::testing::ValuesIn( Map_Iter_Del3_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Map_Iter_Del3_LF, ::testing::ValuesIn( Map_Iter_Del3_LF::get_load_factors()));
#endif
} // namespace map
#else
INSTANTIATE_TEST_CASE_P( SQ,
intrusive_segmented_queue_push_pop,
- ::testing::ValuesIn( intrusive_segmented_queue_push_pop::get_test_parameters()) );
+ ::testing::ValuesIn( intrusive_segmented_queue_push_pop::get_test_parameters()));
#endif
#else
INSTANTIATE_TEST_CASE_P( SQ,
segmented_queue_pop,
- ::testing::ValuesIn( segmented_queue_pop::get_test_parameters()) );
+ ::testing::ValuesIn( segmented_queue_pop::get_test_parameters()));
#endif
#else
INSTANTIATE_TEST_CASE_P( SQ,
segmented_queue_push,
- ::testing::ValuesIn( segmented_queue_push::get_test_parameters()) );
+ ::testing::ValuesIn( segmented_queue_push::get_test_parameters()));
#endif
#else
INSTANTIATE_TEST_CASE_P( SQ,
segmented_queue_push_pop,
- ::testing::ValuesIn( segmented_queue_push_pop::get_test_parameters()) );
+ ::testing::ValuesIn( segmented_queue_push_pop::get_test_parameters()));
#endif
} // namespace
}
INSTANTIATE_TEST_CASE_P( a, Set_Del3_LF, ::testing::ValuesIn( Set_Del3_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Set_Del3_LF, ::testing::ValuesIn( Set_Del3_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Set_Del3_LF, ::testing::ValuesIn( Set_Del3_LF::get_load_factors()));
#endif
} // namespace set
}
INSTANTIATE_TEST_CASE_P( a, Set_DelOdd_LF, ::testing::ValuesIn( Set_DelOdd_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Set_DelOdd_LF, ::testing::ValuesIn( Set_DelOdd_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Set_DelOdd_LF, ::testing::ValuesIn( Set_DelOdd_LF::get_load_factors()));
#endif
} // namespace set
}
INSTANTIATE_TEST_CASE_P( a, Set_InsDelFind_LF, ::testing::ValuesIn( Set_InsDelFind_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Set_InsDelFind_LF, ::testing::ValuesIn( Set_InsDelFind_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Set_InsDelFind_LF, ::testing::ValuesIn( Set_InsDelFind_LF::get_load_factors()));
#endif
} // namespace set
}
INSTANTIATE_TEST_CASE_P( a, Set_InsDel_func_LF, ::testing::ValuesIn( Set_InsDel_func_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Set_InsDel_func_LF, ::testing::ValuesIn( Set_InsDel_func_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Set_InsDel_func_LF, ::testing::ValuesIn( Set_InsDel_func_LF::get_load_factors()));
#endif
} // namespace set
}
INSTANTIATE_TEST_CASE_P( a, Set_InsDel_string_LF, ::testing::ValuesIn( Set_InsDel_string_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Set_InsDel_string_LF, ::testing::ValuesIn( Set_InsDel_string_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Set_InsDel_string_LF, ::testing::ValuesIn( Set_InsDel_string_LF::get_load_factors()));
#endif
}
INSTANTIATE_TEST_CASE_P( a, Set_Iter_Del3_LF, ::testing::ValuesIn( Set_Iter_Del3_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Set_Iter_Del3_LF, ::testing::ValuesIn( Set_Iter_Del3_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Set_Iter_Del3_LF, ::testing::ValuesIn( Set_Iter_Del3_LF::get_load_factors()));
#endif
} // namespace set
}
INSTANTIATE_TEST_CASE_P( a, Set_Iteration_LF, ::testing::ValuesIn( Set_Iteration_LF::get_load_factors()), get_test_parameter_name );
#else
- INSTANTIATE_TEST_CASE_P( a, Set_Iteration_LF, ::testing::ValuesIn( Set_Iteration_LF::get_load_factors()) );
+ INSTANTIATE_TEST_CASE_P( a, Set_Iteration_LF, ::testing::ValuesIn( Set_Iteration_LF::get_load_factors()));
#endif
} // namespace set
// enqueue/dequeue
for ( unsigned pass = 0; pass < 3; ++pass ) {
for ( size_t i = 0; i < nSize; ++i ) {
- ASSERT_TRUE( q.enqueue( static_cast<value_type>( i )) );
+ ASSERT_TRUE( q.enqueue( static_cast<value_type>( i )));
ASSERT_CONTAINER_SIZE( q, i + 1 );
}
ASSERT_FALSE( q.empty());
ASSERT_FALSE( q.full());
ASSERT_CONTAINER_SIZE( q, nArrCount * nArrSize );
for ( size_t i = nArrCount * nArrSize; i < nSize; ++i ) {
- ASSERT_TRUE( q.enqueue( static_cast<value_type>( i )) );
+ ASSERT_TRUE( q.enqueue( static_cast<value_type>( i )));
}
}
ASSERT_TRUE( q.full());