/tests/cppunit/*.o
*.o
*.d
-/todo-2.0.txt
/tests/data/dictionary.txt
/bin
obj
--- /dev/null
+//$$CDS-header$$
+
+#ifndef CDSLIB_ALGO_SPLIT_BITSTRING_H
+#define CDSLIB_ALGO_SPLIT_BITSTRING_H
+
+#include <cds/algo/base.h>
+
+namespace cds { namespace algo {
+
+ /// Cuts a bit sequence from fixed-size bit-string
+ /**
+ The splitter an be used as iterator over bit-string.
+ Each call of \p cut() or \p safe_cut() cuts the bit count specified
+ and keeps the position inside bit-string for the next call.
+
+ The splitter stores a const reference to bit-string, not a copy.
+ The maximum count of bits that can be cut for single call is <tt> sizeof(UInt) * 8 </tt>
+ */
+ template <typename BitString, typename UInt = size_t >
+ class split_bitstring
+ {
+ public:
+ typedef BitString bitstring; ///< Bit-string type
+ typedef UInt uint_type; ///< Bit-string portion type
+
+ //@cond
+ static CDS_CONSTEXPR size_t const c_nHashSize = (sizeof(bitstring) + sizeof(uint_type) - 1) / sizeof(uint_type);
+ static CDS_CONSTEXPR size_t const c_nBitPerByte = 8;
+ static CDS_CONSTEXPR size_t const c_nBitPerHash = sizeof(bitstring) * c_nBitPerByte;
+ static CDS_CONSTEXPR size_t const c_nBitPerInt = sizeof(uint_type) * c_nBitPerByte;
+ //@endcond
+
+ public:
+ /// Initializises the splitter with reference to \p h
+ explicit split_bitstring( bitstring const& h )
+ : m_ptr(reinterpret_cast<uint_type const*>( &h ))
+ , m_pos(0)
+ , m_first( m_ptr )
+# ifdef _DEBUG
+ , m_last( m_ptr + c_nHashSize )
+# endif
+ {}
+
+ /// Returns \p true if end-of-string is not reached yet
+ explicit operator bool() const
+ {
+ return !eos();
+ }
+
+ /// Returns \p true if end-of-stream encountered
+ bool eos() const
+ {
+ return m_pos >= c_nBitPerHash;
+ }
+
+ /// Cuts next \p nBits from bit-string
+ /**
+ Precondition: <tt>nBits <= sizeof(uint_type) * 8</tt>
+
+ This function does not manage out-of-bound condition.
+ To control that use \p safe_cut().
+ */
+ uint_type cut( size_t nBits )
+ {
+ assert( !eos() );
+ assert( nBits <= c_nBitPerInt );
+ assert( m_pos + nBits <= c_nBitPerHash );
+# ifdef _DEBUG
+ assert( m_ptr < m_last );
+# endif
+ uint_type result;
+
+ size_t const nRest = c_nBitPerInt - m_pos % c_nBitPerInt;
+ m_pos += nBits;
+ if ( nBits < nRest ) {
+ result = *m_ptr << ( nRest - nBits );
+ result = result >> ( c_nBitPerInt - nBits );
+ }
+ else if ( nBits == nRest ) {
+ result = *m_ptr >> ( c_nBitPerInt - nRest );
+ ++m_ptr;
+ }
+ else {
+ size_t const lsb = *m_ptr >> ( c_nBitPerInt - nRest );
+ nBits -= nRest;
+ ++m_ptr;
+
+ result = *m_ptr << ( c_nBitPerInt - nBits );
+ result = result >> ( c_nBitPerInt - nBits );
+ result = (result << nRest) + lsb;
+ }
+
+ assert( m_pos <= c_nBitPerHash );
+# ifdef _DEBUG
+ assert( m_ptr <= m_last );
+# endif
+ return result;
+ }
+
+ /// Cuts up to \p nBits from the bit-string
+ /**
+ Analog of \p cut() but if \p nBits is more than the rest of bit-string,
+ only the rest is returned.
+ If \p eos() is \p true the function returns 0.
+ */
+ uint_type safe_cut( size_t nBits )
+ {
+ if ( eos() )
+ return 0;
+
+ assert( nBits <= sizeof(uint_type) * c_nBitPerByte );
+
+ if ( m_pos + nBits > c_nBitPerHash )
+ nBits = c_nBitPerHash - m_pos;
+ return nBits ? cut( nBits ) : 0;
+ }
+
+ /// Resets the splitter
+ void reset()
+ {
+ m_ptr = m_first;
+ m_pos = 0;
+ }
+
+ private:
+ //@cond
+ uint_type const* m_ptr; ///< current position in the hash
+ size_t m_pos; ///< current position in bits
+ uint_type const* m_first; ///< first position
+# ifdef _DEBUG
+ uint_type const* m_last; ///< last position
+# endif
+ //@endcond
+ };
+
+}} // namespace cds::algo
+
+#endif // #ifndef CDSLIB_ALGO_SPLIT_BITSTRING_H
#include <memory.h> // memcmp, memcpy
#include <type_traits>
+
#include <cds/intrusive/details/base.h>
#include <cds/opt/compare.h>
#include <cds/algo/atomic.h>
+#include <cds/algo/split_bitstring.h>
#include <cds/details/marked_ptr.h>
#include <cds/urcu/options.h>
event_counter m_nSlotChanged; ///< Number of array node slot changing by other thread during an operation
event_counter m_nSlotConverting; ///< Number of events when we encounter a slot while it is converting to array node
+ //@cond
void onInsertSuccess() { ++m_nInsertSuccess; }
void onInserFailed() { ++m_nInsertFailed; }
void onInsertRetry() { ++m_nInsertRetry; }
void onEraseSuccess() { ++m_nEraseSuccess; }
void onEraseFailed() { ++m_nEraseFailed; }
void onEraseRetry() { ++m_nEraseRetry; }
- void onFindSuccess() { ++m_nFinSuccess; }
+ void onFindSuccess() { ++m_nFindSuccess; }
void onFindFailed() { ++m_nFindFailed; }
void onExpandNodeSuccess() { ++m_nExpandNodeSuccess; }
void onExpandNodeFailed() { ++m_nExpandNodeFailed; }
void onSlotChanged() { ++m_nSlotChanged; }
void onSlotConverting() { ++m_nSlotConverting; }
+ //@endcond
};
/// \p MultiLevelHashSet empty internal statistics
template <typename T>
struct bitwise_compare
{
+ /// Compares \p lhs and \p rhs
+ /**
+ Returns:
+ - <tt> < 0</tt> if <tt>lhs < rhs</tt>
+ - <tt>0</tt> if <tt>lhs == rhs</tt>
+ - <tt> > 0</tt> if <tt>lhs > rhs</tt>
+ */
int operator()( T const& lhs, T const& rhs ) const
{
return memcmp( &lhs, &rhs, sizeof(T));
//@cond
namespace details {
template <typename HashType, typename UInt = size_t >
- class hash_splitter
- {
- public:
- typedef HashType hash_type;
- typedef UInt uint_type;
-
- static CDS_CONSTEXPR size_t const c_nHashSize = (sizeof(hash_type) + sizeof(uint_type) - 1) / sizeof(uint_type);
- static CDS_CONSTEXPR size_t const c_nBitPerByte = 8;
- static CDS_CONSTEXPR size_t const c_nBitPerHash = sizeof(hash_type) * c_nBitPerByte;
- static CDS_CONSTEXPR size_t const c_nBitPerInt = sizeof(uint_type) * c_nBitPerByte;
-
- public:
- explicit hash_splitter( hash_type const& h )
- : m_ptr(reinterpret_cast<uint_type const*>( &h ))
- , m_pos(0)
- , m_first( m_ptr )
-# ifdef _DEBUG
- , m_last( m_ptr + c_nHashSize )
-# endif
- {}
-
- explicit operator bool() const
- {
- return !eos();
- }
-
- // end-of-bitstring
- bool eos() const
- {
- return m_pos >= c_nBitPerHash;
- }
-
- uint_type cut( size_t nBits )
- {
- assert( !eos() );
- assert( nBits <= c_nBitPerInt );
- assert( m_pos + nBits <= c_nBitPerHash );
-# ifdef _DEBUG
- assert( m_ptr < m_last );
-# endif
- uint_type result;
-
- size_t const nRest = c_nBitPerInt - m_pos % c_nBitPerInt;
- m_pos += nBits;
- if ( nBits < nRest ) {
- result = *m_ptr << ( nRest - nBits );
- result = result >> ( c_nBitPerInt - nBits );
- }
- else if ( nBits == nRest ) {
- result = *m_ptr >> ( c_nBitPerInt - nRest );
- ++m_ptr;
- }
- else {
- size_t const lsb = *m_ptr >> ( c_nBitPerInt - nRest );
- nBits -= nRest;
- ++m_ptr;
-
- result = *m_ptr << ( c_nBitPerInt - nBits );
- result = result >> ( c_nBitPerInt - nBits );
- result = (result << nRest) + lsb;
- }
-
- assert( m_pos <= c_nBitPerHash );
-# ifdef _DEBUG
- assert( m_ptr < m_last );
-# endif
- return result;
- }
-
- uint_type safe_cut( size_t nBits )
- {
- assert( !eos() );
- assert( nBits <= sizeof(uint_type) * c_nBitPerByte );
-
- if ( m_pos + nBits > c_nBitPerHash )
- nBits = c_nBitPerHash - m_pos;
- return nBits ? cut( nBits ) : 0;
- }
-
- void reset()
- {
- m_ptr = m_first;
- m_pos = 0;
- }
-
- private:
- uint_type const* m_ptr; ///< current position in the hash
- size_t m_pos; ///< current position in bits
- uint_type const* m_first; ///< first position
-# ifdef _DEBUG
- uint_type const* m_last; ///< last position
-# endif
- };
+ using hash_splitter = cds::algo::split_bitstring< HashType, UInt >;
} // namespace details
//@endcond
have identical hash then you cannot insert both that keys in the set. \p %MultiLevelHashSet does not maintain the key,\r
it maintains its fixed-size hash value.\r
\r
+ Template parameters:\r
+ - \p GC - safe memory reclamation schema. Can be \p gc::HP, \p gc::DHP or one of \ref cds_urcu_type "RCU type"\r
+ - \p T - a value type to be stored in the set\r
+ - \p Traits - type traits, the structure based on \p multilevel_hashset::traits or result of \p multilevel_hashset::make_traits metafunction\r
\r
There are several specializations of \p %MultiLevelHashSet for each \p GC. You should include:
- <tt><cds/intrusive/multilevel_hashset_hp.h></tt> for \p gc::HP garbage collector
- <tt><cds/intrusive/multilevel_hashset_dhp.h></tt> for \p gc::DHP garbage collector
- - <tt><cds/intrusive/multilevel_hashset_nogc.h></tt> for \ref cds_intrusive_MultiLevelHashSet_nogc for append-only set
- <tt><cds/intrusive/multilevel_hashset_rcu.h></tt> for \ref cds_intrusive_MultiLevelHashSet_rcu "RCU type"
*/
template <
decltype( hash_accessor()( std::declval<T>()) )
>::type
>::type hash_type;
- static_assert( !std::is_pointer<hash_type>, "hash_accessor should return a reference to hash value" );
+ static_assert( !std::is_pointer<hash_type>::value, "hash_accessor should return a reference to hash value" );
typedef typename traits::disposer disposer; ///< data node disposer
hash_type const& hash = hash_accessor()( val );
hash_splitter splitter( hash );
hash_comparator cmp;
- gc::Guard guard;
+ typename gc::Guard guard;
back_off bkoff;
atomic_node_ptr * pArr = m_Head;
else {
// the slot is empty, try to insert data node
node_ptr pNull;
- if ( pArr[nSlot].compare_exchange_strong( pNull, node_ptr( &val ), memory_model::memory_order_release, atomics::memory_order_relaxed )
+ if ( pArr[nSlot].compare_exchange_strong( pNull, node_ptr( &val ), memory_model::memory_order_release, atomics::memory_order_relaxed ))
{
// the new data node has been inserted
f( val );
hash_type const& hash = hash_accessor()( val );
hash_splitter splitter( hash );
hash_comparator cmp;
- gc::Guard guard;
+ typename gc::Guard guard;
back_off bkoff;
atomic_node_ptr * pArr = m_Head;
// the slot is empty, try to insert data node
if ( bInsert ) {
node_ptr pNull;
- if ( pArr[nSlot].compare_exchange_strong( pNull, node_ptr( &val ), memory_model::memory_order_release, atomics::memory_order_relaxed )
+ if ( pArr[nSlot].compare_exchange_strong( pNull, node_ptr( &val ), memory_model::memory_order_release, atomics::memory_order_relaxed ))
{
// the new data node has been inserted
f( val );
}
else {
m_Stat.onUpdateFailed();
- return std:make_pair( false, false );
+ return std::make_pair( false, false );
}
// insert failed - slot has been changed by another thread
{
typename gc::Guard guard;
auto pred = [&val](value_type const& item) -> bool { return &item == &val; };
- value_type * p = do_erase( hash, guard, std::ref( pred ));
+ value_type * p = do_erase( hash_accessor()( val ), guard, std::ref( pred ));
// p is guarded by HP
if ( p ) {
metrics m;
m.head_node_size_log = head_bits;
- m.head_node_size = 1 << head_bits;
+ m.head_node_size = size_t(1) << head_bits;
m.array_node_size_log = array_bits;
- m.array_node_size = 1 << array_bits;
+ m.array_node_size = size_t(1) << array_bits;
return m;
}
- template <typename T>
- static bool check_node_alignment( T * p )
+ template <typename Q>
+ static bool check_node_alignment( Q const* p )
{
return (reinterpret_cast<uintptr_t>(p) & node_ptr::bitmask) == 0;
}
atomic_node_ptr * alloc_array_node() const
{
- return cxx_array_node_allocator().NewArray( array_node_size(), nullptr )
+ return cxx_array_node_allocator().NewArray( array_node_size(), nullptr );
}
void free_array_node( atomic_node_ptr * parr ) const
}
else {
// data node
- if ( pArr->compare_exchange_strong( slot, node_ptr(), memory_model::memory_order_acquire, atomics::memory_order_relaxed ) ) {
- gc::template retire<disposer>( p );
+ if ( pArr->compare_exchange_strong( slot, node_ptr(), memory_model::memory_order_acquire, atomics::memory_order_relaxed )) {
+ gc::template retire<disposer>( slot.ptr() );
--m_ItemCounter;
m_Stat.onEraseSuccess();
break;
pArr[idx].store( current, memory_model::memory_order_release );
cur = cur | array_converting;
- CDS_VERIFY( slot.compare_exchange_strong( cur, node_ptr( to_node( pArr ), array_node ), memory_model::memory_order_release, atomics::memory_order_relaxed )));
+ CDS_VERIFY(
+ slot.compare_exchange_strong( cur, node_ptr( to_node( pArr ), array_node ), memory_model::memory_order_release, atomics::memory_order_relaxed )
+ );
return std::make_pair( pArr, idx );
}
}} // namespace cds::intrusive
#endif // #ifndef CDSLIB_INTRUSIVE_IMPL_MULTILEVEL_HASHSET_H
-1
\ No newline at end of file
<ClInclude Include="..\..\..\cds\algo\backoff_strategy.h" />\r
<ClInclude Include="..\..\..\cds\algo\base.h" />\r
<ClInclude Include="..\..\..\cds\algo\bitop.h" />\r
+ <ClInclude Include="..\..\..\cds\algo\split_bitstring.h" />\r
<ClInclude Include="..\..\..\cds\algo\elimination.h" />\r
<ClInclude Include="..\..\..\cds\algo\elimination_opt.h" />\r
<ClInclude Include="..\..\..\cds\algo\elimination_tls.h" />\r
<ClInclude Include="..\..\..\cds\intrusive\multilevel_hashset_dhp.h">\r
<Filter>Header Files\cds\intrusive</Filter>\r
</ClInclude>\r
+ <ClInclude Include="..\..\..\cds\algo\split_bitstring.h">\r
+ <Filter>Header Files\cds\algo</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
</Project>
\ No newline at end of file
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
<ClCompile Include="..\..\..\tests\test-hdr\misc\find_option.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\misc\hash_tuple.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\misc\michael_allocator.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\misc\split_bitstring.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\misc\thread_init_fini.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\misc\permutation_generator.cpp" />\r
</ItemGroup>\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
+ <ClInclude Include="..\..\..\tests\test-hdr\set\hdr_intrusive_multilevel_hashset.h" />\r
<ClInclude Include="..\..\..\tests\test-hdr\set\hdr_intrusive_set.h" />\r
<ClInclude Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_set.h" />\r
<ClInclude Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_set_rcu.h" />\r
<ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_michael_set_rcu_shb_lazy.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_michael_set_rcu_sht.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_michael_set_rcu_sht_lazy.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_multilevel_hashset_hp.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_dhp.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_dhp_member.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_skiplist_hp.cpp" />\r
<ClInclude Include="..\..\..\tests\test-hdr\set\hdr_skiplist_set_rcu.h">\r
<Filter>container\skip_list</Filter>\r
</ClInclude>\r
+ <ClInclude Include="..\..\..\tests\test-hdr\set\hdr_intrusive_multilevel_hashset.h">\r
+ <Filter>intrusive\multilevel_hashset</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
<ItemGroup>\r
<Filter Include="intrusive">\r
<Filter Include="container\split_list">\r
<UniqueIdentifier>{61f94a40-c964-4233-af67-66a1be1e0aab}</UniqueIdentifier>\r
</Filter>\r
+ <Filter Include="intrusive\multilevel_hashset">\r
+ <UniqueIdentifier>{a878aed0-83c9-4ca7-95bb-74f10aad8bde}</UniqueIdentifier>\r
+ </Filter>\r
</ItemGroup>\r
<ItemGroup>\r
<ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_michael_set_hp.cpp">\r
<ClCompile Include="..\..\..\tests\test-hdr\set\hdr_skiplist_set_dhp.cpp">\r
<Filter>container\skip_list</Filter>\r
</ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\set\hdr_intrusive_multilevel_hashset_hp.cpp">\r
+ <Filter>intrusive\multilevel_hashset</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
</Project>
\ No newline at end of file
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
<Profile>true</Profile>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX86</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
<DataExecutionPrevention>\r
</DataExecutionPrevention>\r
<TargetMachine>MachineX64</TargetMachine>\r
+ <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
tests/test-hdr/queue/hdr_vyukov_mpmc_cyclic.cpp
CDS_TESTHDR_SET := \
+ tests/test-hdr/set/hdr_intrusive_multilevel_hashset_hp.cpp \
tests/test-hdr/set/hdr_intrusive_refinable_hashset_avlset.cpp \
tests/test-hdr/set/hdr_intrusive_refinable_hashset_list.cpp \
tests/test-hdr/set/hdr_intrusive_refinable_hashset_set.cpp \
test_int<set>();
}
-
-
} // namespace set
+
CPPUNIT_TEST_SUITE_REGISTRATION(set::IntrusiveHashSetHdrTest);
--- /dev/null
+//$$CDS-header$$
+
+#ifndef CDSTEST_HDR_INTRUSIVE_MULTILEVEL_HASHSET_H
+#define CDSTEST_HDR_INTRUSIVE_MULTILEVEL_HASHSET_H
+
+#include "cppunit/cppunit_proxy.h"
+
+// forward declaration
+namespace cds {
+ namespace intrusive {}
+ namespace opt {}
+}
+
+namespace set {
+ namespace ci = cds::intrusive;
+ namespace co = cds::opt;
+
+ class IntrusiveMultiLevelHashSetHdrTest: public CppUnitMini::TestCase
+ {
+ template <typename Hash>
+ struct Item
+ {
+ unsigned int nDisposeCount ; // count of disposer calling
+ Hash hash;
+ };
+
+ template <typename Hash>
+ struct get_hash
+ {
+ Hash const& operator()( Item<Hash> const& i ) const
+ {
+ return i.hash;
+ }
+ };
+
+ template <typename Set>
+ void test_hp()
+ {
+ Set s;
+ }
+
+ void hp_stdhash();
+
+ CPPUNIT_TEST_SUITE(IntrusiveMultiLevelHashSetHdrTest)
+ CPPUNIT_TEST(hp_stdhash)
+ CPPUNIT_TEST_SUITE_END()
+ };
+} // namespace set
+
+#endif // #ifndef CDSTEST_HDR_INTRUSIVE_MULTILEVEL_HASHSET_H
--- /dev/null
+//$$CDS-header$$
+
+#include "set/hdr_intrusive_multilevel_hashset.h"
+#include <cds/intrusive/multilevel_hashset_hp.h>
+
+namespace set {
+ namespace {
+ typedef cds::gc::HP gc_type;
+ } // namespace
+
+ void IntrusiveMultiLevelHashSetHdrTest::hp_stdhash()
+ {
+ typedef size_t hash_type;
+
+ struct traits: public ci::multilevel_hashset::traits
+ {
+ typedef get_hash<hash_type> hash_accessor;
+ };
+ typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
+ test_hp<set_type>();
+
+ typedef ci::MultiLevelHashSet<
+ gc_type,
+ Item<hash_type>,
+ typename ci::multilevel_hashset::make_traits<
+ ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
+ >::type
+ > set_type2;
+ test_hp<set_type2>();
+ }
+} // namespace set
+
+CPPUNIT_TEST_SUITE_REGISTRATION(set::IntrusiveMultiLevelHashSetHdrTest);