projects
/
libcds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removing unused vars
[libcds.git]
/
tests
/
unit
/
map2
/
map_delodd.cpp
diff --git
a/tests/unit/map2/map_delodd.cpp
b/tests/unit/map2/map_delodd.cpp
index 4eb1512d284e36a9a9718a9b44b8fb5f656ad7c5..f1ecb3f4d67aa263cb3b14db2c0d07792c4cc1e7 100644
(file)
--- a/
tests/unit/map2/map_delodd.cpp
+++ b/
tests/unit/map2/map_delodd.cpp
@@
-106,6
+106,7
@@
namespace boost {
{
return std::hash<size_t>()( k.nKey );
}
{
return std::hash<size_t>()( k.nKey );
}
+
template <>
struct hash<map2::key_thread>
{
template <>
struct hash<map2::key_thread>
{
@@
-126,7
+127,7
@@
namespace boost {
namespace map2 {
template <typename Map>
namespace map2 {
template <typename Map>
- static inline void check_before_clear( Map&
s
)
+ static inline void check_before_clear( Map&
/*s*/
)
{}
template <typename GC, typename Key, typename T, typename Traits>
{}
template <typename GC, typename Key, typename T, typename Traits>
@@
-160,7
+161,7
@@
namespace map2 {
struct ensure_func
{
template <typename Q>
struct ensure_func
{
template <typename Q>
- void operator()( bool
bNew
, Q const& )
+ void operator()( bool
/*bNew*/
, Q const& )
{}
};
public:
{}
};
public:
@@
-360,10
+361,12
@@
namespace map2 {
for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
for ( size_t i = 0; i < arrData.size(); ++i ) {
if ( arrData[i] & 1 ) {
for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
for ( size_t i = 0; i < arrData.size(); ++i ) {
if ( arrData[i] & 1 ) {
- if ( rMap.extract_with( gp, arrData[i], key_less() ))
+ gp = rMap.extract_with( arrData[i], key_less());
+ if ( gp )
++m_nDeleteSuccess;
else
++m_nDeleteFailed;
++m_nDeleteSuccess;
else
++m_nDeleteFailed;
+ gp.release();
}
}
if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
}
}
if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
@@
-374,10
+377,12
@@
namespace map2 {
for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
for ( size_t i = arrData.size() - 1; i > 0; --i ) {
if ( arrData[i] & 1 ) {
for ( size_t k = 0; k < c_nInsThreadCount; ++k ) {
for ( size_t i = arrData.size() - 1; i > 0; --i ) {
if ( arrData[i] & 1 ) {
- if ( rMap.extract_with( gp, arrData[i], key_less() ))
+ gp = rMap.extract_with( arrData[i], key_less());
+ if ( gp )
++m_nDeleteSuccess;
else
++m_nDeleteFailed;
++m_nDeleteSuccess;
else
++m_nDeleteFailed;
+ gp.release();
}
}
if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
}
}
if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
@@
-435,22
+440,21
@@
namespace map2 {
if ( Map::c_bExtractLockExternal ) {
{
typename Map::rcu_lock l;
if ( Map::c_bExtractLockExternal ) {
{
typename Map::rcu_lock l;
- if ( rMap.extract_with( xp, arrData[i], key_less() )) {
+ xp = rMap.extract_with( arrData[i], key_less() );
+ if ( xp )
++m_nDeleteSuccess;
++m_nDeleteSuccess;
- }
else
++m_nDeleteFailed;
}
else
++m_nDeleteFailed;
}
- xp.release();
}
else {
}
else {
- if ( rMap.extract_with( xp, arrData[i], key_less() )) {
+ xp = rMap.extract_with( arrData[i], key_less() );
+ if ( xp )
++m_nDeleteSuccess;
++m_nDeleteSuccess;
- xp.release();
- }
else
++m_nDeleteFailed;
}
else
++m_nDeleteFailed;
}
+ xp.release();
}
}
if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
}
}
if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
@@
-464,21
+468,21
@@
namespace map2 {
if ( Map::c_bExtractLockExternal ) {
{
typename Map::rcu_lock l;
if ( Map::c_bExtractLockExternal ) {
{
typename Map::rcu_lock l;
- if ( rMap.extract_with( xp, arrData[i], key_less() ))
+ xp = rMap.extract_with( arrData[i], key_less() );
+ if ( xp )
++m_nDeleteSuccess;
else
++m_nDeleteFailed;
}
++m_nDeleteSuccess;
else
++m_nDeleteFailed;
}
- xp.release();
}
else {
}
else {
- if ( rMap.extract_with( xp, arrData[i], key_less() )) {
+ xp = rMap.extract_with( arrData[i], key_less() );
+ if ( xp )
++m_nDeleteSuccess;
++m_nDeleteSuccess;
- xp.release();
- }
else
++m_nDeleteFailed;
}
else
++m_nDeleteFailed;
}
+ xp.release();
}
}
if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
}
}
if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )