From c34b46ba50daf781053c4cf6e517d94188c802ed Mon Sep 17 00:00:00 2001 From: khizmax Date: Sun, 23 Aug 2015 18:49:16 +0300 Subject: [PATCH] Removed trailing whitespaces --- cds/algo/flat_combining.h | 4 +- cds/algo/split_bitstring.h | 2 +- cds/compiler/clang/defs.h | 2 +- cds/compiler/feature_tsan.h | 80 +++++----- cds/container/details/bronson_avltree_base.h | 12 +- cds/container/details/make_lazy_kvlist.h | 4 +- cds/container/details/make_lazy_list.h | 4 +- .../details/multilevel_hashmap_base.h | 14 +- .../details/multilevel_hashset_base.h | 4 +- cds/container/impl/bronson_avltree_map_rcu.h | 10 +- cds/container/impl/multilevel_hashmap.h | 126 ++++++++-------- cds/container/impl/multilevel_hashset.h | 132 ++++++++-------- cds/container/impl/skip_list_set.h | 4 +- cds/container/michael_kvlist_rcu.h | 2 +- cds/container/michael_list_rcu.h | 2 +- cds/container/skip_list_map_nogc.h | 2 +- cds/container/vyukov_mpmc_cycle_queue.h | 12 +- cds/details/defs.h | 18 +-- cds/gc/details/dhp.h | 10 +- cds/gc/impl/dhp_decl.h | 2 +- cds/gc/impl/hp_decl.h | 2 +- cds/init.h | 4 +- cds/intrusive/details/lazy_list_base.h | 2 +- .../details/multilevel_hashset_base.h | 4 +- cds/intrusive/impl/michael_list.h | 6 +- cds/intrusive/impl/multilevel_hashset.h | 142 +++++++++--------- cds/intrusive/mspriority_queue.h | 2 +- cds/intrusive/split_list.h | 2 +- cds/intrusive/split_list_nogc.h | 2 +- cds/intrusive/split_list_rcu.h | 2 +- cds/intrusive/treiber_stack.h | 2 +- cds/memory/vyukov_queue_pool.h | 2 +- cds/opt/compare.h | 12 +- cds/os/alloc_aligned.h | 2 +- cds/sync/injecting_monitor.h | 4 +- cds/sync/pool_monitor.h | 26 ++-- src/hp_gc.cpp | 2 +- tests/cppunit/cppunit_mini.h | 2 +- tests/cppunit/test_main.cpp | 2 +- .../hdr_intrusive_michael_list_rcu_gpi.cpp | 8 +- tests/test-hdr/list/hdr_lazy.h | 2 +- tests/test-hdr/list/hdr_lazy_kv.h | 2 +- tests/test-hdr/map/hdr_multilevel_hashmap.h | 8 +- .../set/hdr_intrusive_multilevel_hashset.h | 2 +- .../hdr_intrusive_multilevel_hashset_dhp.cpp | 48 +++--- .../hdr_intrusive_multilevel_hashset_hp.cpp | 48 +++--- tests/test-hdr/set/hdr_intrusive_set.h | 2 +- tests/test-hdr/set/hdr_multilevel_hashset.h | 14 +- .../set/hdr_multilevel_hashset_dhp.cpp | 48 +++--- .../set/hdr_multilevel_hashset_hp.cpp | 48 +++--- tests/test-hdr/tree/hdr_bronson_avltree_map.h | 18 +-- .../tree/hdr_bronson_avltree_map_rcu_gpb.cpp | 22 +-- ...onson_avltree_map_rcu_gpb_pool_monitor.cpp | 12 +- .../tree/hdr_bronson_avltree_map_rcu_gpi.cpp | 22 +-- ...onson_avltree_map_rcu_gpi_pool_monitor.cpp | 12 +- .../tree/hdr_bronson_avltree_map_rcu_gpt.cpp | 22 +-- ...onson_avltree_map_rcu_gpt_pool_monitor.cpp | 12 +- .../tree/hdr_bronson_avltree_map_rcu_shb.cpp | 22 +-- ...onson_avltree_map_rcu_shb_pool_monitor.cpp | 12 +- .../tree/hdr_bronson_avltree_map_rcu_sht.cpp | 22 +-- ...onson_avltree_map_rcu_sht_pool_monitor.cpp | 12 +- tests/unit/map2/map_insdel_func.cpp | 2 +- tests/unit/map2/map_insdel_string.cpp | 2 +- tests/unit/map2/map_type_bronson_avltree.h | 8 +- tests/unit/pqueue/pop.cpp | 2 +- tools/make_distrib.pl | 2 +- 66 files changed, 551 insertions(+), 551 deletions(-) diff --git a/cds/algo/flat_combining.h b/cds/algo/flat_combining.h index 0f382d40..afc71e5d 100644 --- a/cds/algo/flat_combining.h +++ b/cds/algo/flat_combining.h @@ -741,8 +741,8 @@ namespace cds { namespace algo { // Thinning publication list publication_record * pPrev = nullptr; for ( publication_record * p = m_pHead; p; ) { - if ( p->nState.load( memory_model::memory_order_acquire ) == active - && p->nAge.load( memory_model::memory_order_acquire ) + m_nCompactFactor < nCurAge ) + if ( p->nState.load( memory_model::memory_order_acquire ) == active + && p->nAge.load( memory_model::memory_order_acquire ) + m_nCompactFactor < nCurAge ) { if ( pPrev ) { publication_record * pNext = p->pNext.load( memory_model::memory_order_acquire ); diff --git a/cds/algo/split_bitstring.h b/cds/algo/split_bitstring.h index 432c4038..b556ad03 100644 --- a/cds/algo/split_bitstring.h +++ b/cds/algo/split_bitstring.h @@ -5,7 +5,7 @@ #include -namespace cds { namespace algo { +namespace cds { namespace algo { /// Cuts a bit sequence from fixed-size bit-string /** diff --git a/cds/compiler/clang/defs.h b/cds/compiler/clang/defs.h index ff6fb794..f10449ec 100644 --- a/cds/compiler/clang/defs.h +++ b/cds/compiler/clang/defs.h @@ -40,7 +40,7 @@ // C++11 thread_local keyword #if !(CDS_OS_TYPE == CDS_OS_OSX && CDS_COMPILER_VERSION < 30600) - // OS X error? + // OS X error? // See http://stackoverflow.com/questions/23791060/c-thread-local-storage-clang-503-0-40-mac-osx // http://stackoverflow.com/questions/28094794/why-does-apple-clang-disallow-c11-thread-local-when-official-clang-supports // clang 3.6 ok?.. diff --git a/cds/compiler/feature_tsan.h b/cds/compiler/feature_tsan.h index f2ceaa83..ba5e3ef1 100644 --- a/cds/compiler/feature_tsan.h +++ b/cds/compiler/feature_tsan.h @@ -9,49 +9,49 @@ //@cond #ifdef CDS_THREAD_SANITIZER_ENABLED -# define CDS_TSAN_ANNOTATE_HAPPENS_BEFORE(addr) AnnotateHappensBefore(__FILE__, __LINE__, reinterpret_cast(addr)) -# define CDS_TSAN_ANNOTATE_HAPPENS_AFTER(addr) AnnotateHappensAfter(__FILE__, __LINE__, reinterpret_cast(addr)) - -# define CDS_TSAN_ANNOTATE_IGNORE_READS_BEGIN AnnotateIgnoreReadsBegin(__FILE__, __LINE__) -# define CDS_TSAN_ANNOTATE_IGNORE_READS_END AnnotateIgnoreReadsEnd(__FILE__, __LINE__) -# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN AnnotateIgnoreWritesBegin(__FILE__, __LINE__) -# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_END AnnotateIgnoreWritesEnd(__FILE__, __LINE__) -# define CDS_TSAN_ANNOTATE_IGNORE_RW_BEGIN \ - CDS_TSAN_ANNOTATE_IGNORE_READS_BEGIN; \ - CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN -# define CDS_TSAN_ANNOTATE_IGNORE_RW_END \ - CDS_TSAN_ANNOTATE_IGNORE_WRITES_END;\ - CDS_TSAN_ANNOTATE_IGNORE_READS_END -# define CDS_TSAN_ANNOTATE_NEW_MEMORY( addr, sz ) AnnotateNewMemory( (char *) __FILE__, __LINE__, reinterpret_cast(addr), sz ) - - // provided by TSan - extern "C" { - void AnnotateHappensBefore(const char *f, int l, void *addr); - void AnnotateHappensAfter(const char *f, int l, void *addr); - - void AnnotateIgnoreReadsBegin(const char *f, int l); - void AnnotateIgnoreReadsEnd(const char *f, int l); - void AnnotateIgnoreWritesBegin(const char *f, int l); - void AnnotateIgnoreWritesEnd(const char *f, int l); - +# define CDS_TSAN_ANNOTATE_HAPPENS_BEFORE(addr) AnnotateHappensBefore(__FILE__, __LINE__, reinterpret_cast(addr)) +# define CDS_TSAN_ANNOTATE_HAPPENS_AFTER(addr) AnnotateHappensAfter(__FILE__, __LINE__, reinterpret_cast(addr)) + +# define CDS_TSAN_ANNOTATE_IGNORE_READS_BEGIN AnnotateIgnoreReadsBegin(__FILE__, __LINE__) +# define CDS_TSAN_ANNOTATE_IGNORE_READS_END AnnotateIgnoreReadsEnd(__FILE__, __LINE__) +# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN AnnotateIgnoreWritesBegin(__FILE__, __LINE__) +# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_END AnnotateIgnoreWritesEnd(__FILE__, __LINE__) +# define CDS_TSAN_ANNOTATE_IGNORE_RW_BEGIN \ + CDS_TSAN_ANNOTATE_IGNORE_READS_BEGIN; \ + CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN +# define CDS_TSAN_ANNOTATE_IGNORE_RW_END \ + CDS_TSAN_ANNOTATE_IGNORE_WRITES_END;\ + CDS_TSAN_ANNOTATE_IGNORE_READS_END +# define CDS_TSAN_ANNOTATE_NEW_MEMORY( addr, sz ) AnnotateNewMemory( (char *) __FILE__, __LINE__, reinterpret_cast(addr), sz ) + + // provided by TSan + extern "C" { + void AnnotateHappensBefore(const char *f, int l, void *addr); + void AnnotateHappensAfter(const char *f, int l, void *addr); + + void AnnotateIgnoreReadsBegin(const char *f, int l); + void AnnotateIgnoreReadsEnd(const char *f, int l); + void AnnotateIgnoreWritesBegin(const char *f, int l); + void AnnotateIgnoreWritesEnd(const char *f, int l); + void AnnotateNewMemory(char *f, int l, void * mem, size_t size); - - } - -#else // CDS_THREAD_SANITIZER_ENABLED - -# define CDS_TSAN_ANNOTATE_HAPPENS_BEFORE(addr) + + } + +#else // CDS_THREAD_SANITIZER_ENABLED + +# define CDS_TSAN_ANNOTATE_HAPPENS_BEFORE(addr) # define CDS_TSAN_ANNOTATE_HAPPENS_AFTER(addr) -# define CDS_TSAN_ANNOTATE_IGNORE_READS_BEGIN -# define CDS_TSAN_ANNOTATE_IGNORE_READS_END -# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN -# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_END -# define CDS_TSAN_ANNOTATE_IGNORE_RW_BEGIN -# define CDS_TSAN_ANNOTATE_IGNORE_RW_END - -# define CDS_TSAN_ANNOTATE_NEW_MEMORY( addr, sz ) - +# define CDS_TSAN_ANNOTATE_IGNORE_READS_BEGIN +# define CDS_TSAN_ANNOTATE_IGNORE_READS_END +# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN +# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_END +# define CDS_TSAN_ANNOTATE_IGNORE_RW_BEGIN +# define CDS_TSAN_ANNOTATE_IGNORE_RW_END + +# define CDS_TSAN_ANNOTATE_NEW_MEMORY( addr, sz ) + #endif //@endcond diff --git a/cds/container/details/bronson_avltree_base.h b/cds/container/details/bronson_avltree_base.h index 178e0bd3..7b5273d9 100644 --- a/cds/container/details/bronson_avltree_base.h +++ b/cds/container/details/bronson_avltree_base.h @@ -243,12 +243,12 @@ namespace cds { namespace container { void onDisposeNode() { ++m_nDisposedNode; } void onDisposeValue() { ++m_nDisposedValue; } void onExtractValue() { ++m_nExtractedValue; } - void onRemove(bool bSuccess) - { - if ( bSuccess ) - ++m_nRemoveSuccess; - else - ++m_nRemoveFailed; + void onRemove(bool bSuccess) + { + if ( bSuccess ) + ++m_nRemoveSuccess; + else + ++m_nRemoveFailed; } void onExtract( bool bSuccess ) { diff --git a/cds/container/details/make_lazy_kvlist.h b/cds/container/details/make_lazy_kvlist.h index 8169f32b..8fad9f83 100644 --- a/cds/container/details/make_lazy_kvlist.h +++ b/cds/container/details/make_lazy_kvlist.h @@ -89,11 +89,11 @@ namespace cds { namespace container { typename equal_to_wrapper< typename original_type_traits::equal_to >::type >::type equal_to; - typedef typename std::conditional< + typedef typename std::conditional< original_type_traits::sort || !std::is_same< typename original_type_traits::compare, cds::opt::none >::value || !std::is_same< typename original_type_traits::less, cds::opt::none >::value, - cds::details::compare_wrapper< + cds::details::compare_wrapper< node_type, typename opt::details::make_comparator< value_type, original_type_traits >::type, key_field_accessor diff --git a/cds/container/details/make_lazy_list.h b/cds/container/details/make_lazy_list.h index 57d8b816..20477c3d 100644 --- a/cds/container/details/make_lazy_list.h +++ b/cds/container/details/make_lazy_list.h @@ -78,8 +78,8 @@ namespace cds { namespace container { typename equal_to_wrapper< typename original_type_traits::equal_to >::type >::type equal_to; - typedef typename std::conditional< - original_type_traits::sort + typedef typename std::conditional< + original_type_traits::sort || !std::is_same::value || !std::is_same::value, cds::details::compare_wrapper< diff --git a/cds/container/details/multilevel_hashmap_base.h b/cds/container/details/multilevel_hashmap_base.h index aac4dce1..7a3a7498 100644 --- a/cds/container/details/multilevel_hashmap_base.h +++ b/cds/container/details/multilevel_hashmap_base.h @@ -30,9 +30,9 @@ namespace cds { namespace container { /// Hash functor, default is \p std::hash /** \p MultiLevelHashMap may use any hash functor converting a key to - fixed-sized bit-string, for example, SHA1, SHA2, - MurmurHash, - CityHash + fixed-sized bit-string, for example, SHA1, SHA2, + MurmurHash, + CityHash or its successor FarmHash. */ typedef opt::none hash; @@ -100,12 +100,12 @@ namespace cds { namespace container { @copydetails traits::node_allocator - \p opt::compare - hash comparison functor. No default functor is provided. If the option is not specified, the \p opt::less is used. - - \p opt::less - specifies binary predicate used for hash comparison. + - \p opt::less - specifies binary predicate used for hash comparison. @copydetails cds::container::multilevel_hashmap::traits::less - \p opt::back_off - back-off strategy used. If the option is not specified, the \p cds::backoff::Default is used. - \p opt::item_counter - the type of item counting feature. @copydetails cds::container::multilevel_hashmap::traits::item_counter - - \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default) + - \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default) or \p opt::v::sequential_consistent (sequentially consisnent memory model). - \p opt::stat - internal statistics. By default, it is disabled (\p multilevel_hashmap::empty_stat). To enable it use \p multilevel_hashmap::stat @@ -144,7 +144,7 @@ namespace cds { namespace container { typedef Traits original_traits; typedef typename cds::opt::v::hash_selector< typename original_traits::hash >::type hasher; - typedef typename std::decay< + typedef typename std::decay< typename std::remove_reference< decltype( hasher()( std::declval()) ) >::type @@ -152,7 +152,7 @@ namespace cds { namespace container { //typedef typename std::result_of< hasher( std::declval()) >::type hash_type; static_assert( !std::is_pointer::value, "hash functor should return a reference to hash value" ); - struct node_type + struct node_type { std::pair< key_type const, mapped_type> m_Value; hash_type const m_hash; diff --git a/cds/container/details/multilevel_hashset_base.h b/cds/container/details/multilevel_hashset_base.h index c3b8911b..f6656aff 100644 --- a/cds/container/details/multilevel_hashset_base.h +++ b/cds/container/details/multilevel_hashset_base.h @@ -102,12 +102,12 @@ namespace cds { namespace container { @copydetails traits::node_allocator - \p opt::compare - hash comparison functor. No default functor is provided. If the option is not specified, the \p opt::less is used. - - \p opt::less - specifies binary predicate used for hash comparison. + - \p opt::less - specifies binary predicate used for hash comparison. @copydetails cds::container::multilevel_hashset::traits::less - \p opt::back_off - back-off strategy used. If the option is not specified, the \p cds::backoff::Default is used. - \p opt::item_counter - the type of item counting feature. @copydetails cds::intrusive::multilevel_hashset::traits::item_counter - - \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default) + - \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default) or \p opt::v::sequential_consistent (sequentially consisnent memory model). - \p opt::stat - internal statistics. By default, it is disabled (\p multilevel_hashset::empty_stat). To enable it use \p multilevel_hashset::stat diff --git a/cds/container/impl/bronson_avltree_map_rcu.h b/cds/container/impl/bronson_avltree_map_rcu.h index 515f289f..4451ad8c 100644 --- a/cds/container/impl/bronson_avltree_map_rcu.h +++ b/cds/container/impl/bronson_avltree_map_rcu.h @@ -1487,8 +1487,8 @@ namespace cds { namespace container { if ( !pNode->is_valued( memory_model::memory_order_acquire ) ) return update_flags::failed; - if ( child( pNode, left_child, memory_model::memory_order_acquire ) == nullptr - || child( pNode, right_child, memory_model::memory_order_acquire ) == nullptr ) + if ( child( pNode, left_child, memory_model::memory_order_acquire ) == nullptr + || child( pNode, right_child, memory_model::memory_order_acquire ) == nullptr ) { // pNode can be replaced with its child @@ -1682,7 +1682,7 @@ namespace cds { namespace container { } } - assert( child( pParent, left_child, memory_model::memory_order_relaxed ) == pNode + assert( child( pParent, left_child, memory_model::memory_order_relaxed ) == pNode || child( pParent, right_child, memory_model::memory_order_relaxed ) == pNode ); int h = height( pNode, memory_model::memory_order_acquire ); @@ -1708,7 +1708,7 @@ namespace cds { namespace container { node_type * rebalance_to_right_locked( node_type * pParent, node_type * pNode, node_type * pLeft, int hR ) { assert( parent( pNode, memory_model::memory_order_relaxed ) == pParent ); - assert( child( pParent, left_child, memory_model::memory_order_relaxed ) == pNode + assert( child( pParent, left_child, memory_model::memory_order_relaxed ) == pNode || child( pParent, right_child, memory_model::memory_order_relaxed ) == pNode ); // pParent and pNode is locked yet @@ -1762,7 +1762,7 @@ namespace cds { namespace container { node_type * rebalance_to_left_locked( node_type * pParent, node_type * pNode, node_type * pRight, int hL ) { assert( parent( pNode, memory_model::memory_order_relaxed ) == pParent ); - assert( child( pParent, left_child, memory_model::memory_order_relaxed ) == pNode + assert( child( pParent, left_child, memory_model::memory_order_relaxed ) == pNode || child( pParent, right_child, memory_model::memory_order_relaxed ) == pNode ); // pParent and pNode is locked yet diff --git a/cds/container/impl/multilevel_hashmap.h b/cds/container/impl/multilevel_hashmap.h index a9e29f50..1c0a1937 100644 --- a/cds/container/impl/multilevel_hashmap.h +++ b/cds/container/impl/multilevel_hashmap.h @@ -36,56 +36,56 @@ namespace cds { namespace container { \p %MultiLevelHashMap is a multi-level array which has an internal structure similar to a tree: @image html multilevel_hashset.png The multi-level array differs from a tree in that each position on the tree could hold an array of nodes or a single node. - A position that holds a single node is a \p dataNode which holds the hash value of a key and the value that is associated - with that key; it is a simple struct holding two variables. A \p dataNode in the multi-level array could be marked. - A \p markedDataNode refers to a pointer to a \p dataNode that has been bitmarked at the least significant bit (LSB) - of the pointer to the node. This signifies that this \p dataNode is contended. An expansion must occur at this node; - any thread that sees this \p markedDataNode will try to replace it with an \p arrayNode; which is a position that holds - an array of nodes. The pointer to an \p arrayNode is differentiated from that of a pointer to a \p dataNode by a bitmark - on the second-least significant bit. - - \p %MultiLevelHashMap multi-level array is similar to a tree in that we keep a pointer to the root, which is a memory array - called \p head. The length of the \p head memory array is unique, whereas every other \p arrayNode has a uniform length; - a normal \p arrayNode has a fixed power-of-two length equal to the binary logarithm of a variable called \p arrayLength. - The maximum depth of the tree, \p maxDepth, is the maximum number of pointers that must be followed to reach any node. - We define \p currentDepth as the number of memory arrays that we need to traverse to reach the \p arrayNode on which - we need to operate; this is initially one, because of \p head. - - That approach to the structure of the hash map uses an extensible hashing scheme; the hash value is treated as a bit - string and rehash incrementally. - - @note Two important things you should keep in mind when you're using \p %MultiLevelHashMap: - - all keys is converted to fixed-size bit-string by hash functor provided. - You can use variable-length keys, for example, \p std::string as a key for \p %MultiLevelHashMap, - but real key in the map will be fixed-ize hash values of your keys. - For the strings you may use well-known hashing algorithms like SHA1, SHA2, - MurmurHash, CityHash - or its successor FarmHash and so on, which - converts variable-length strings to fixed-length bit-strings, and such hash values will be the keys in \p %MultiLevelHashMap. - - \p %MultiLevelHashMap uses a perfect hashing. It means that if two different keys, for example, of type \p std::string, - have identical hash then you cannot insert both that keys in the map. \p %MultiLevelHashMap does not maintain the key, - it maintains its fixed-size hash value. - - The map supports @ref cds_container_MultilevelHashMap_iterators "bidirectional thread-safe iterators". - - Template parameters: - - \p GC - safe memory reclamation schema. Can be \p gc::HP, \p gc::DHP or one of \ref cds_urcu_type "RCU type" - - \p Key - a key type to be stored in the map - - \p T - a value type to be stored in the map - - \p Traits - type traits, the structure based on \p multilevel_hashmap::traits or result of \p multilevel_hashmap::make_traits metafunction. - + A position that holds a single node is a \p dataNode which holds the hash value of a key and the value that is associated + with that key; it is a simple struct holding two variables. A \p dataNode in the multi-level array could be marked. + A \p markedDataNode refers to a pointer to a \p dataNode that has been bitmarked at the least significant bit (LSB) + of the pointer to the node. This signifies that this \p dataNode is contended. An expansion must occur at this node; + any thread that sees this \p markedDataNode will try to replace it with an \p arrayNode; which is a position that holds + an array of nodes. The pointer to an \p arrayNode is differentiated from that of a pointer to a \p dataNode by a bitmark + on the second-least significant bit. + + \p %MultiLevelHashMap multi-level array is similar to a tree in that we keep a pointer to the root, which is a memory array + called \p head. The length of the \p head memory array is unique, whereas every other \p arrayNode has a uniform length; + a normal \p arrayNode has a fixed power-of-two length equal to the binary logarithm of a variable called \p arrayLength. + The maximum depth of the tree, \p maxDepth, is the maximum number of pointers that must be followed to reach any node. + We define \p currentDepth as the number of memory arrays that we need to traverse to reach the \p arrayNode on which + we need to operate; this is initially one, because of \p head. + + That approach to the structure of the hash map uses an extensible hashing scheme; the hash value is treated as a bit + string and rehash incrementally. + + @note Two important things you should keep in mind when you're using \p %MultiLevelHashMap: + - all keys is converted to fixed-size bit-string by hash functor provided. + You can use variable-length keys, for example, \p std::string as a key for \p %MultiLevelHashMap, + but real key in the map will be fixed-ize hash values of your keys. + For the strings you may use well-known hashing algorithms like SHA1, SHA2, + MurmurHash, CityHash + or its successor FarmHash and so on, which + converts variable-length strings to fixed-length bit-strings, and such hash values will be the keys in \p %MultiLevelHashMap. + - \p %MultiLevelHashMap uses a perfect hashing. It means that if two different keys, for example, of type \p std::string, + have identical hash then you cannot insert both that keys in the map. \p %MultiLevelHashMap does not maintain the key, + it maintains its fixed-size hash value. + + The map supports @ref cds_container_MultilevelHashMap_iterators "bidirectional thread-safe iterators". + + Template parameters: + - \p GC - safe memory reclamation schema. Can be \p gc::HP, \p gc::DHP or one of \ref cds_urcu_type "RCU type" + - \p Key - a key type to be stored in the map + - \p T - a value type to be stored in the map + - \p Traits - type traits, the structure based on \p multilevel_hashmap::traits or result of \p multilevel_hashmap::make_traits metafunction. + There are several specializations of \p %MultiLevelHashMap for each \p GC. You should include: - for \p gc::HP garbage collector - for \p gc::DHP garbage collector - for \ref cds_intrusive_MultiLevelHashMap_rcu "RCU type". RCU specialization has a slightly different interface. */ - template < + template < class GC ,typename Key ,typename T #ifdef CDS_DOXYGEN_INVOKED - ,class Traits = multilevel_hashmap::traits + ,class Traits = multilevel_hashmap::traits #else ,class Traits #endif @@ -463,8 +463,8 @@ namespace cds { namespace container { std::pair update( K&& key, Func func, bool bInsert = true ) { scoped_node_ptr sp( cxx_node_allocator().MoveNew( m_Hasher, std::forward(key))); - std::pair result = base_class::do_update( *sp, - [&func]( node_type& node, node_type * old ) { func( node.m_Value, old ? &old->m_Value : nullptr );}, + std::pair result = base_class::do_update( *sp, + [&func]( node_type& node, node_type * old ) { func( node.m_Value, old ? &old->m_Value : nullptr );}, bInsert ); if ( result.first ) sp.release(); @@ -527,7 +527,7 @@ namespace cds { namespace container { //@endcond /// Extracts the item from the map with specified \p key - /** + /** The function searches an item with key equal to hash( key_type( key )) in the map, unlinks it from the map, and returns a guarded pointer to the item found. If \p key is not found the function returns an empty guarded pointer. @@ -683,25 +683,25 @@ namespace cds { namespace container { public: ///@name Thread-safe iterators /** @anchor cds_container_MultilevelHashMap_iterators - The map supports thread-safe iterators: you may iterate over the map in multi-threaded environment. - It is guaranteed that the iterators will remain valid even if another thread deletes the node the iterator points to: - Hazard Pointer embedded into the iterator object protects the node from physical reclamation. - - @note Since the iterator object contains hazard pointer that is a thread-local resource, - the iterator should not be passed to another thread. - - Each iterator object supports the common interface: - - dereference operators: - @code - value_type [const] * operator ->() noexcept - value_type [const] & operator *() noexcept - @endcode - - pre-increment and pre-decrement. Post-operators is not supported - - equality operators == and !=. + The map supports thread-safe iterators: you may iterate over the map in multi-threaded environment. + It is guaranteed that the iterators will remain valid even if another thread deletes the node the iterator points to: + Hazard Pointer embedded into the iterator object protects the node from physical reclamation. + + @note Since the iterator object contains hazard pointer that is a thread-local resource, + the iterator should not be passed to another thread. + + Each iterator object supports the common interface: + - dereference operators: + @code + value_type [const] * operator ->() noexcept + value_type [const] & operator *() noexcept + @endcode + - pre-increment and pre-decrement. Post-operators is not supported + - equality operators == and !=. Iterators are equal iff they point to the same cell of the same array node. - Note that for two iterators \p it1 and \p it2, the conditon it1 == it2 + Note that for two iterators \p it1 and \p it2, the conditon it1 == it2 does not entail &(*it1) == &(*it2) - - helper member function \p release() that clears internal hazard pointer. + - helper member function \p release() that clears internal hazard pointer. After \p release() call the iterator points to \p nullptr but it still remain valid: further iterating is possible. */ ///@{ @@ -723,19 +723,19 @@ namespace cds { namespace container { return base_class::template init_begin(); } - /// Returns an iterator to the element following the last element of the map. This element acts as a placeholder; attempting to access it results in undefined behavior. + /// Returns an iterator to the element following the last element of the map. This element acts as a placeholder; attempting to access it results in undefined behavior. iterator end() { return base_class::template init_end(); } - /// Returns a const iterator to the element following the last element of the map. This element acts as a placeholder; attempting to access it results in undefined behavior. + /// Returns a const iterator to the element following the last element of the map. This element acts as a placeholder; attempting to access it results in undefined behavior. const_iterator end() const { return base_class::template init_end(); } - /// Returns a const iterator to the element following the last element of the map. This element acts as a placeholder; attempting to access it results in undefined behavior. + /// Returns a const iterator to the element following the last element of the map. This element acts as a placeholder; attempting to access it results in undefined behavior. const_iterator cend() { return base_class::template init_end(); diff --git a/cds/container/impl/multilevel_hashset.h b/cds/container/impl/multilevel_hashset.h index fcc0452c..1cd7c143 100644 --- a/cds/container/impl/multilevel_hashset.h +++ b/cds/container/impl/multilevel_hashset.h @@ -35,43 +35,43 @@ namespace cds { namespace container { \p %MultiLevelHashSet is a multi-level array which has an internal structure similar to a tree: @image html multilevel_hashset.png The multi-level array differs from a tree in that each position on the tree could hold an array of nodes or a single node. - A position that holds a single node is a \p dataNode which holds the hash value of a key and the value that is associated - with that key; it is a simple struct holding two variables. A \p dataNode in the multi-level array could be marked. - A \p markedDataNode refers to a pointer to a \p dataNode that has been bitmarked at the least significant bit (LSB) - of the pointer to the node. This signifies that this \p dataNode is contended. An expansion must occur at this node; - any thread that sees this \p markedDataNode will try to replace it with an \p arrayNode; which is a position that holds - an array of nodes. The pointer to an \p arrayNode is differentiated from that of a pointer to a \p dataNode by a bitmark - on the second-least significant bit. - - \p %MultiLevelHashSet multi-level array is similar to a tree in that we keep a pointer to the root, which is a memory array - called \p head. The length of the \p head memory array is unique, whereas every other \p arrayNode has a uniform length; - a normal \p arrayNode has a fixed power-of-two length equal to the binary logarithm of a variable called \p arrayLength. - The maximum depth of the tree, \p maxDepth, is the maximum number of pointers that must be followed to reach any node. - We define \p currentDepth as the number of memory arrays that we need to traverse to reach the \p arrayNode on which - we need to operate; this is initially one, because of \p head. - - That approach to the structure of the hash set uses an extensible hashing scheme; the hash value is treated as a bit - string and rehash incrementally. - - @note Two important things you should keep in mind when you're using \p %MultiLevelHashSet: - - all keys must be fixed-size. It means that you cannot use \p std::string as a key for \p %MultiLevelHashSet. - Instead, for the strings you should use well-known hashing algorithms like SHA1, SHA2, - MurmurHash, CityHash - or its successor FarmHash and so on, which - converts variable-length strings to fixed-length bit-strings, and use that hash as a key in \p %MultiLevelHashSet. - - \p %MultiLevelHashSet uses a perfect hashing. It means that if two different keys, for example, of type \p std::string, - have identical hash then you cannot insert both that keys in the set. \p %MultiLevelHashSet does not maintain the key, - it maintains its fixed-size hash value. - - The set supports @ref cds_container_MultilevelHashSet_iterators "bidirectional thread-safe iterators". - - Template parameters: - - \p GC - safe memory reclamation schema. Can be \p gc::HP, \p gc::DHP or one of \ref cds_urcu_type "RCU type" - - \p T - a value type to be stored in the set - - \p Traits - type traits, the structure based on \p multilevel_hashset::traits or result of \p multilevel_hashset::make_traits metafunction. - \p Traits is the mandatory argument because it has one mandatory type - an @ref multilevel_hashset::traits::hash_accessor "accessor" - to hash value of \p T. The set algorithm does not calculate that hash value. - + A position that holds a single node is a \p dataNode which holds the hash value of a key and the value that is associated + with that key; it is a simple struct holding two variables. A \p dataNode in the multi-level array could be marked. + A \p markedDataNode refers to a pointer to a \p dataNode that has been bitmarked at the least significant bit (LSB) + of the pointer to the node. This signifies that this \p dataNode is contended. An expansion must occur at this node; + any thread that sees this \p markedDataNode will try to replace it with an \p arrayNode; which is a position that holds + an array of nodes. The pointer to an \p arrayNode is differentiated from that of a pointer to a \p dataNode by a bitmark + on the second-least significant bit. + + \p %MultiLevelHashSet multi-level array is similar to a tree in that we keep a pointer to the root, which is a memory array + called \p head. The length of the \p head memory array is unique, whereas every other \p arrayNode has a uniform length; + a normal \p arrayNode has a fixed power-of-two length equal to the binary logarithm of a variable called \p arrayLength. + The maximum depth of the tree, \p maxDepth, is the maximum number of pointers that must be followed to reach any node. + We define \p currentDepth as the number of memory arrays that we need to traverse to reach the \p arrayNode on which + we need to operate; this is initially one, because of \p head. + + That approach to the structure of the hash set uses an extensible hashing scheme; the hash value is treated as a bit + string and rehash incrementally. + + @note Two important things you should keep in mind when you're using \p %MultiLevelHashSet: + - all keys must be fixed-size. It means that you cannot use \p std::string as a key for \p %MultiLevelHashSet. + Instead, for the strings you should use well-known hashing algorithms like SHA1, SHA2, + MurmurHash, CityHash + or its successor FarmHash and so on, which + converts variable-length strings to fixed-length bit-strings, and use that hash as a key in \p %MultiLevelHashSet. + - \p %MultiLevelHashSet uses a perfect hashing. It means that if two different keys, for example, of type \p std::string, + have identical hash then you cannot insert both that keys in the set. \p %MultiLevelHashSet does not maintain the key, + it maintains its fixed-size hash value. + + The set supports @ref cds_container_MultilevelHashSet_iterators "bidirectional thread-safe iterators". + + Template parameters: + - \p GC - safe memory reclamation schema. Can be \p gc::HP, \p gc::DHP or one of \ref cds_urcu_type "RCU type" + - \p T - a value type to be stored in the set + - \p Traits - type traits, the structure based on \p multilevel_hashset::traits or result of \p multilevel_hashset::make_traits metafunction. + \p Traits is the mandatory argument because it has one mandatory type - an @ref multilevel_hashset::traits::hash_accessor "accessor" + to hash value of \p T. The set algorithm does not calculate that hash value. + There are several specializations of \p %MultiLevelHashSet for each \p GC. You should include: - for \p gc::HP garbage collector - for \p gc::DHP garbage collector @@ -254,7 +254,7 @@ namespace cds { namespace container { } /// Deletes the item from the set - /** + /** The function searches \p hash in the set, deletes the item found, and returns \p true. If that item is not found the function returns \p false. @@ -302,12 +302,12 @@ namespace cds { namespace container { //@endcond /// Extracts the item with specified \p hash - /** + /** The function searches \p hash in the set, unlinks it from the set, and returns an guarded pointer to the item extracted. If \p hash is not found the function returns an empty guarded pointer. - The item returned is reclaimed by garbage collector \p GC + The item returned is reclaimed by garbage collector \p GC when returned \ref guarded_ptr object to be destroyed or released. @note Each \p guarded_ptr object uses the GC's guard that can be limited resource. @@ -441,25 +441,25 @@ namespace cds { namespace container { public: ///@name Thread-safe iterators /** @anchor cds_container_MultilevelHashSet_iterators - The set supports thread-safe iterators: you may iterate over the set in multi-threaded environment. - It is guaranteed that the iterators will remain valid even if another thread deletes the node the iterator points to: - Hazard Pointer embedded into the iterator object protects the node from physical reclamation. - - @note Since the iterator object contains hazard pointer that is a thread-local resource, - the iterator should not be passed to another thread. - - Each iterator object supports the common interface: - - dereference operators: - @code - value_type [const] * operator ->() noexcept - value_type [const] & operator *() noexcept - @endcode - - pre-increment and pre-decrement. Post-operators is not supported - - equality operators == and !=. + The set supports thread-safe iterators: you may iterate over the set in multi-threaded environment. + It is guaranteed that the iterators will remain valid even if another thread deletes the node the iterator points to: + Hazard Pointer embedded into the iterator object protects the node from physical reclamation. + + @note Since the iterator object contains hazard pointer that is a thread-local resource, + the iterator should not be passed to another thread. + + Each iterator object supports the common interface: + - dereference operators: + @code + value_type [const] * operator ->() noexcept + value_type [const] & operator *() noexcept + @endcode + - pre-increment and pre-decrement. Post-operators is not supported + - equality operators == and !=. Iterators are equal iff they point to the same cell of the same array node. - Note that for two iterators \p it1 and \p it2, the conditon it1 == it2 + Note that for two iterators \p it1 and \p it2, the conditon it1 == it2 does not entail &(*it1) == &(*it2) - - helper member function \p release() that clears internal hazard pointer. + - helper member function \p release() that clears internal hazard pointer. After \p release() call the iterator points to \p nullptr but it still remain valid: further iterating is possible. */ ///@{ @@ -482,19 +482,19 @@ namespace cds { namespace container { return base_class::cbegin(); } - /// Returns an iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. + /// Returns an iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. iterator end() { return base_class::end(); } - /// Returns a const iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. + /// Returns a const iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. const_iterator end() const { return base_class::end(); } - /// Returns a const iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. + /// Returns a const iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. const_iterator cend() { return base_class::cend(); @@ -520,8 +520,8 @@ namespace cds { namespace container { /// Returns a reverse iterator to the element following the last element of the reversed set /** - It corresponds to the element preceding the first element of the non-reversed container. - This element acts as a placeholder, attempting to access it results in undefined behavior. + It corresponds to the element preceding the first element of the non-reversed container. + This element acts as a placeholder, attempting to access it results in undefined behavior. */ reverse_iterator rend() { @@ -530,8 +530,8 @@ namespace cds { namespace container { /// Returns a const reverse iterator to the element following the last element of the reversed set /** - It corresponds to the element preceding the first element of the non-reversed container. - This element acts as a placeholder, attempting to access it results in undefined behavior. + It corresponds to the element preceding the first element of the non-reversed container. + This element acts as a placeholder, attempting to access it results in undefined behavior. */ const_reverse_iterator rend() const { @@ -540,8 +540,8 @@ namespace cds { namespace container { /// Returns a const reverse iterator to the element following the last element of the reversed set /** - It corresponds to the element preceding the first element of the non-reversed container. - This element acts as a placeholder, attempting to access it results in undefined behavior. + It corresponds to the element preceding the first element of the non-reversed container. + This element acts as a placeholder, attempting to access it results in undefined behavior. */ const_reverse_iterator crend() { diff --git a/cds/container/impl/skip_list_set.h b/cds/container/impl/skip_list_set.h index a310d780..9754e997 100644 --- a/cds/container/impl/skip_list_set.h +++ b/cds/container/impl/skip_list_set.h @@ -255,7 +255,7 @@ namespace cds { namespace container { The operation performs inserting or changing data with lock-free manner. If the \p val key not found in the set, then the new item created from \p val - will be inserted into the set iff \p bInsert is \p true. + will be inserted into the set iff \p bInsert is \p true. Otherwise, if \p val is found, the functor \p func will be called with the item found. The functor \p Func signature: @@ -284,7 +284,7 @@ namespace cds { namespace container { { scoped_node_ptr sp( node_allocator().New( random_level(), val )); std::pair bRes = base_class::update( *sp, - [&func, &val](bool bNew, node_type& node, node_type&){ func( bNew, node.m_Value, val ); }, + [&func, &val](bool bNew, node_type& node, node_type&){ func( bNew, node.m_Value, val ); }, bInsert ); if ( bRes.first && bRes.second ) sp.release(); diff --git a/cds/container/michael_kvlist_rcu.h b/cds/container/michael_kvlist_rcu.h index 6c4f61b8..3efaf063 100644 --- a/cds/container/michael_kvlist_rcu.h +++ b/cds/container/michael_kvlist_rcu.h @@ -540,7 +540,7 @@ namespace cds { namespace container { unlinks it from the list, and returns \ref cds::urcu::exempt_ptr "exempt_ptr" pointer to the item found. If \p key is not found the function returns an empty \p exempt_ptr. - @note The function does NOT dispose the item found. + @note The function does NOT dispose the item found. It just excludes the item from the list and returns a pointer to item found. You shouldn't lock RCU before calling this function. diff --git a/cds/container/michael_list_rcu.h b/cds/container/michael_list_rcu.h index 31baa2ee..d4558ddf 100644 --- a/cds/container/michael_list_rcu.h +++ b/cds/container/michael_list_rcu.h @@ -536,7 +536,7 @@ namespace cds { namespace container { // The RCU should NOT be locked when extract() is called! assert( !rcu::is_locked() ); - + // extract() call p = theList.extract( 10 ) if ( p ) { diff --git a/cds/container/skip_list_map_nogc.h b/cds/container/skip_list_map_nogc.h index 932fbea8..79ef6769 100644 --- a/cds/container/skip_list_map_nogc.h +++ b/cds/container/skip_list_map_nogc.h @@ -241,7 +241,7 @@ namespace cds { namespace container { Otherwise, if \p key is found, the function returns an iterator that points to item found. Returns std::pair where \p first is an iterator pointing to - item found or inserted or \p end() if \p key is not found and insertion is not allowed (\p bInsert is \p false), + item found or inserted or \p end() if \p key is not found and insertion is not allowed (\p bInsert is \p false), \p second is \p true if new item has been added or \p false if the item already exists. */ template diff --git a/cds/container/vyukov_mpmc_cycle_queue.h b/cds/container/vyukov_mpmc_cycle_queue.h index 6bde6641..1a726276 100644 --- a/cds/container/vyukov_mpmc_cycle_queue.h +++ b/cds/container/vyukov_mpmc_cycle_queue.h @@ -267,13 +267,13 @@ namespace cds { namespace container { /// Enqueues data of type \ref value_type constructed with std::forward(args)... template bool emplace( Args&&... args ) - { + { #if (CDS_COMPILER == CDS_COMPILER_GCC) && (CDS_COMPILER_VERSION < 40900) - //work around unsupported feature in g++ 4.8 for forwarding parameter packs to lambda. - return enqueue_with ( std::bind([]( value_type& dest,Args ... args ){ new ( &dest ) value_type( std::forward(args)... );}, std::placeholders::_1 ,args...)); -#else - return enqueue_with( [&args ...]( value_type& dest ){ new ( &dest ) value_type( std::forward(args)... ); }); -#endif + //work around unsupported feature in g++ 4.8 for forwarding parameter packs to lambda. + return enqueue_with ( std::bind([]( value_type& dest,Args ... args ){ new ( &dest ) value_type( std::forward(args)... );}, std::placeholders::_1 ,args...)); +#else + return enqueue_with( [&args ...]( value_type& dest ){ new ( &dest ) value_type( std::forward(args)... ); }); +#endif } /// Dequeues a value using a functor diff --git a/cds/details/defs.h b/cds/details/defs.h index 4f593330..faa39be4 100644 --- a/cds/details/defs.h +++ b/cds/details/defs.h @@ -21,7 +21,7 @@ The main namespace for the library is \ref cds. To see the full list of container's class go to modules tab. - + Supported processor architectures and operating systems (OS) are: - x86 [32bit] Linux, Windows, FreeBSD, MinGW - amd64 (x86-64) [64bit] Linux, Windows, FreeBSD, MinGW @@ -32,7 +32,7 @@ Supported compilers: - GCC 4.8+ - - Clang 3.3+ + - Clang 3.3+ - MS Visual C++ 2013 Update 4 and above - Intel C++ Compiler 15 @@ -41,11 +41,11 @@ schema used. However, any implementation supports common interface for the type of data structure. To use any lock-free data structure, the following are needed: - - atomic operation library conforming with C++11 memory model. - The libcds can be built with \p std::atomic, \p boost::atomic or its own + - atomic operation library conforming with C++11 memory model. + The libcds can be built with \p std::atomic, \p boost::atomic or its own @ref cds_cxx11_atomic "atomic implementation" - - safe memory reclamation (SMR) or garbage collecting (GC) algorithm. - + - safe memory reclamation (SMR) or garbage collecting (GC) algorithm. + SMR is the main part of lock-free data structs. The SMR solves the problem of safe memory reclamation that is one of the main problem for lock-free programming. The library contains the implementations of several light-weight \ref cds_garbage_collector "memory reclamation schemes": @@ -130,12 +130,12 @@ } \endcode - + \par How to build The cds is mostly header-only library. Only small part of library related to GC core functionality - should be compiled. - + should be compiled. + The test projects depends on the following static library from \p boost: - \p boost.thread - \p boost.date_time diff --git a/cds/gc/details/dhp.h b/cds/gc/details/dhp.h index ecff8506..939fd2fd 100644 --- a/cds/gc/details/dhp.h +++ b/cds/gc/details/dhp.h @@ -418,10 +418,10 @@ namespace cds { namespace gc { pItem = m_pEpochFree[ nEpoch = current_epoch() ].load(atomics::memory_order_acquire); if ( !pItem ) goto retry; - if ( m_pEpochFree[nEpoch].compare_exchange_weak( pItem, - pItem->m_pNextFree.load(atomics::memory_order_acquire), + if ( m_pEpochFree[nEpoch].compare_exchange_weak( pItem, + pItem->m_pNextFree.load(atomics::memory_order_acquire), atomics::memory_order_acquire, atomics::memory_order_relaxed )) - { + { goto success; } } @@ -436,8 +436,8 @@ namespace cds { namespace gc { goto retry; } // pItem is changed by compare_exchange_weak - } while ( !m_pGlobalFreeHead.compare_exchange_weak( pItem, - pItem->m_pNextFree.load(atomics::memory_order_acquire), + } while ( !m_pGlobalFreeHead.compare_exchange_weak( pItem, + pItem->m_pNextFree.load(atomics::memory_order_acquire), atomics::memory_order_acquire, atomics::memory_order_relaxed )); success: diff --git a/cds/gc/impl/dhp_decl.h b/cds/gc/impl/dhp_decl.h index 94ee0ad1..a588db7b 100644 --- a/cds/gc/impl/dhp_decl.h +++ b/cds/gc/impl/dhp_decl.h @@ -579,7 +579,7 @@ namespace cds { namespace gc { \par Parameters - \p nLiberateThreshold - \p scan() threshold. When count of retired pointers reaches this value, the \p scan() member function would be called for freeing retired pointers. - - \p nInitialThreadGuardCount - initial count of guard allocated for each thread. + - \p nInitialThreadGuardCount - initial count of guard allocated for each thread. When a thread is initialized the GC allocates local guard pool for the thread from common guard pool. By perforce the local thread's guard pool is grown automatically from common pool. When the thread terminated its guard pool is backed to common GC's pool. diff --git a/cds/gc/impl/hp_decl.h b/cds/gc/impl/hp_decl.h index f2e42084..863b1406 100644 --- a/cds/gc/impl/hp_decl.h +++ b/cds/gc/impl/hp_decl.h @@ -605,7 +605,7 @@ namespace cds { namespace gc { /// Terminates GC singleton /** The destructor destroys %HP global object. After calling of this function you may \b NOT - use CDS data structures based on \p %cds::gc::HP. + use CDS data structures based on \p %cds::gc::HP. Usually, %HP object is destroyed at the end of your \p main(). */ ~HP() diff --git a/cds/init.h b/cds/init.h index e97c8d70..742914aa 100644 --- a/cds/init.h +++ b/cds/init.h @@ -24,11 +24,11 @@ namespace cds { by calling \p %Initialize() function, see \ref cds_how_to_use "how to use the library". You can call \p Initialize several times, only first call is significant others will be ignored. - To terminate the \p CDS library correctly, each call to \p %Initialize() must be balanced + To terminate the \p CDS library correctly, each call to \p %Initialize() must be balanced by a corresponding \p Terminate() call. Note, that this function does not initialize garbage collectors. To use GC you need you should call - GC-specific constructor function to initialize internal structures of GC. + GC-specific constructor function to initialize internal structures of GC. See \p cds::gc for details. */ static inline void Initialize( diff --git a/cds/intrusive/details/lazy_list_base.h b/cds/intrusive/details/lazy_list_base.h index 9f60c431..19b3b07e 100644 --- a/cds/intrusive/details/lazy_list_base.h +++ b/cds/intrusive/details/lazy_list_base.h @@ -217,7 +217,7 @@ namespace cds { namespace intrusive { /// Specifies list ordering policy /** - If \p sort is \p true, than list maintains items in sorted order, otherwise the list is unordered. + If \p sort is \p true, than list maintains items in sorted order, otherwise the list is unordered. Default is \p true. Note that if \p sort is \p false, than lookup operations scan entire list. */ diff --git a/cds/intrusive/details/multilevel_hashset_base.h b/cds/intrusive/details/multilevel_hashset_base.h index f8f9e36c..e65168a3 100644 --- a/cds/intrusive/details/multilevel_hashset_base.h +++ b/cds/intrusive/details/multilevel_hashset_base.h @@ -106,7 +106,7 @@ namespace cds { namespace intrusive { }; /// \p MultiLevelHashSet traits - struct traits + struct traits { /// Mandatory functor to get hash value from data node /** @@ -200,7 +200,7 @@ namespace cds { namespace intrusive { @copydetails traits::node_allocator - \p opt::compare - hash comparison functor. No default functor is provided. If the option is not specified, the \p opt::less is used. - - \p opt::less - specifies binary predicate used for hash comparison. + - \p opt::less - specifies binary predicate used for hash comparison. If the option is not specified, \p memcmp() -like bit-wise hash comparator is used because the hash value is treated as fixed-sized bit-string. - \p opt::back_off - back-off strategy used. If the option is not specified, the \p cds::backoff::Default is used. diff --git a/cds/intrusive/impl/michael_list.h b/cds/intrusive/impl/michael_list.h index 590476aa..f66b185c 100644 --- a/cds/intrusive/impl/michael_list.h +++ b/cds/intrusive/impl/michael_list.h @@ -1089,7 +1089,7 @@ namespace cds { namespace intrusive { pNext = nullptr; pCur = pos.guards.protect( position::guard_current_item, *pPrev, - [](marked_node_ptr p) -> value_type * + [](marked_node_ptr p) -> value_type * { return node_traits::to_value_ptr( p.ptr() ); }); @@ -1102,8 +1102,8 @@ namespace cds { namespace intrusive { return false; } - pNext = pos.guards.protect( position::guard_next_item, pCur->m_pNext, - [](marked_node_ptr p ) -> value_type * + pNext = pos.guards.protect( position::guard_next_item, pCur->m_pNext, + [](marked_node_ptr p ) -> value_type * { return node_traits::to_value_ptr( p.ptr() ); }); diff --git a/cds/intrusive/impl/multilevel_hashset.h b/cds/intrusive/impl/multilevel_hashset.h index c86c2f42..96aee685 100644 --- a/cds/intrusive/impl/multilevel_hashset.h +++ b/cds/intrusive/impl/multilevel_hashset.h @@ -37,43 +37,43 @@ namespace cds { namespace intrusive { \p %MultiLevelHashSet is a multi-level array which has a structure similar to a tree: @image html multilevel_hashset.png The multi-level array differs from a tree in that each position on the tree could hold an array of nodes or a single node. - A position that holds a single node is a \p dataNode which holds the hash value of a key and the value that is associated - with that key; it is a simple struct holding two variables. A \p dataNode in the multi-level array could be marked. - A \p markedDataNode refers to a pointer to a \p dataNode that has been bitmarked at the least significant bit (LSB) - of the pointer to the node. This signifies that this \p dataNode is contended. An expansion must occur at this node; - any thread that sees this \p markedDataNode will try to replace it with an \p arrayNode; which is a position that holds - an array of nodes. The pointer to an \p arrayNode is differentiated from that of a pointer to a \p dataNode by a bitmark - on the second-least significant bit. - - \p %MultiLevelHashSet multi-level array is similar to a tree in that we keep a pointer to the root, which is a memory array - called \p head. The length of the \p head memory array is unique, whereas every other \p arrayNode has a uniform length; - a normal \p arrayNode has a fixed power-of-two length equal to the binary logarithm of a variable called \p arrayLength. - The maximum depth of the tree, \p maxDepth, is the maximum number of pointers that must be followed to reach any node. - We define \p currentDepth as the number of memory arrays that we need to traverse to reach the \p arrayNode on which - we need to operate; this is initially one, because of \p head. - - That approach to the structure of the hash set uses an extensible hashing scheme; the hash value is treated as a bit - string and rehash incrementally. - - @note Two important things you should keep in mind when you're using \p %MultiLevelHashSet: - - all keys must be fixed-size. It means that you cannot use \p std::string as a key for \p %MultiLevelHashSet. - Instead, for the strings you should use well-known hashing algorithms like SHA1, SHA2, - MurmurHash, CityHash - or its successor FarmHash and so on, which - converts variable-length strings to fixed-length bit-strings, and use that hash as a key in \p %MultiLevelHashSet. - - \p %MultiLevelHashSet uses a perfect hashing. It means that if two different keys, for example, of type \p std::string, - have identical hash then you cannot insert both that keys in the set. \p %MultiLevelHashSet does not maintain the key, - it maintains its fixed-size hash value. - - The set supports @ref cds_intrusive_MultilevelHashSet_iterators "bidirectional thread-safe iterators". - - Template parameters: - - \p GC - safe memory reclamation schema. Can be \p gc::HP, \p gc::DHP or one of \ref cds_urcu_type "RCU type" - - \p T - a value type to be stored in the set - - \p Traits - type traits, the structure based on \p multilevel_hashset::traits or result of \p multilevel_hashset::make_traits metafunction. - \p Traits is the mandatory argument because it has one mandatory type - an @ref multilevel_hashset::traits::hash_accessor "accessor" - to hash value of \p T. The set algorithm does not calculate that hash value. - + A position that holds a single node is a \p dataNode which holds the hash value of a key and the value that is associated + with that key; it is a simple struct holding two variables. A \p dataNode in the multi-level array could be marked. + A \p markedDataNode refers to a pointer to a \p dataNode that has been bitmarked at the least significant bit (LSB) + of the pointer to the node. This signifies that this \p dataNode is contended. An expansion must occur at this node; + any thread that sees this \p markedDataNode will try to replace it with an \p arrayNode; which is a position that holds + an array of nodes. The pointer to an \p arrayNode is differentiated from that of a pointer to a \p dataNode by a bitmark + on the second-least significant bit. + + \p %MultiLevelHashSet multi-level array is similar to a tree in that we keep a pointer to the root, which is a memory array + called \p head. The length of the \p head memory array is unique, whereas every other \p arrayNode has a uniform length; + a normal \p arrayNode has a fixed power-of-two length equal to the binary logarithm of a variable called \p arrayLength. + The maximum depth of the tree, \p maxDepth, is the maximum number of pointers that must be followed to reach any node. + We define \p currentDepth as the number of memory arrays that we need to traverse to reach the \p arrayNode on which + we need to operate; this is initially one, because of \p head. + + That approach to the structure of the hash set uses an extensible hashing scheme; the hash value is treated as a bit + string and rehash incrementally. + + @note Two important things you should keep in mind when you're using \p %MultiLevelHashSet: + - all keys must be fixed-size. It means that you cannot use \p std::string as a key for \p %MultiLevelHashSet. + Instead, for the strings you should use well-known hashing algorithms like SHA1, SHA2, + MurmurHash, CityHash + or its successor FarmHash and so on, which + converts variable-length strings to fixed-length bit-strings, and use that hash as a key in \p %MultiLevelHashSet. + - \p %MultiLevelHashSet uses a perfect hashing. It means that if two different keys, for example, of type \p std::string, + have identical hash then you cannot insert both that keys in the set. \p %MultiLevelHashSet does not maintain the key, + it maintains its fixed-size hash value. + + The set supports @ref cds_intrusive_MultilevelHashSet_iterators "bidirectional thread-safe iterators". + + Template parameters: + - \p GC - safe memory reclamation schema. Can be \p gc::HP, \p gc::DHP or one of \ref cds_urcu_type "RCU type" + - \p T - a value type to be stored in the set + - \p Traits - type traits, the structure based on \p multilevel_hashset::traits or result of \p multilevel_hashset::make_traits metafunction. + \p Traits is the mandatory argument because it has one mandatory type - an @ref multilevel_hashset::traits::hash_accessor "accessor" + to hash value of \p T. The set algorithm does not calculate that hash value. + There are several specializations of \p %MultiLevelHashSet for each \p GC. You should include: - for \p gc::HP garbage collector - for \p gc::DHP garbage collector @@ -100,7 +100,7 @@ namespace cds { namespace intrusive { static_assert(!std::is_same< hash_accessor, cds::opt::none >::value, "hash_accessor functor must be specified" ); /// Hash type deduced from \p hash_accessor return type - typedef typename std::decay< + typedef typename std::decay< typename std::remove_reference< decltype( hash_accessor()( std::declval()) ) >::type @@ -113,7 +113,7 @@ namespace cds { namespace intrusive { # ifdef CDS_DOXYGEN_INVOKED typedef implementation_defined hash_comparator ; ///< hash compare functor based on opt::compare and opt::less option setter # else - typedef typename cds::opt::details::make_comparator_from< + typedef typename cds::opt::details::make_comparator_from< hash_type, traits, multilevel_hashset::bitwise_compare< hash_type > @@ -181,7 +181,7 @@ namespace cds { namespace intrusive { size_t m_idx; ///< current position in m_pNode typename gc::Guard m_guard; ///< HP guard MultiLevelHashSet const* m_set; ///< Hash set - + public: iterator_base() CDS_NOEXCEPT : m_pNode( nullptr ) @@ -596,7 +596,7 @@ namespace cds { namespace intrusive { /// Inserts new node /** - The function inserts \p val in the set if it does not contain + The function inserts \p val in the set if it does not contain an item with that hash. Returns \p true if \p val is placed into the set, \p false otherwise. @@ -729,7 +729,7 @@ namespace cds { namespace intrusive { } /// Deletes the item from the set - /** + /** The function searches \p hash in the set, unlinks the item found, and returns \p true. If that item is not found the function returns \p false. @@ -789,7 +789,7 @@ namespace cds { namespace intrusive { //@endcond /// Extracts the item with specified \p hash - /** + /** The function searches \p hash in the set, unlinks it from the set, and returns an guarded pointer to the item extracted. If \p hash is not found the function returns an empty guarded pointer. @@ -952,25 +952,25 @@ namespace cds { namespace intrusive { public: ///@name Thread-safe iterators /** @anchor cds_intrusive_MultilevelHashSet_iterators - The set supports thread-safe iterators: you may iterate over the set in multi-threaded environment. - It is guaranteed that the iterators will remain valid even if another thread deletes the node the iterator points to: - Hazard Pointer embedded into the iterator object protects the node from physical reclamation. - - @note Since the iterator object contains hazard pointer that is a thread-local resource, - the iterator should not be passed to another thread. - - Each iterator object supports the common interface: - - dereference operators: - @code - value_type [const] * operator ->() noexcept - value_type [const] & operator *() noexcept - @endcode - - pre-increment and pre-decrement. Post-operators is not supported - - equality operators == and !=. + The set supports thread-safe iterators: you may iterate over the set in multi-threaded environment. + It is guaranteed that the iterators will remain valid even if another thread deletes the node the iterator points to: + Hazard Pointer embedded into the iterator object protects the node from physical reclamation. + + @note Since the iterator object contains hazard pointer that is a thread-local resource, + the iterator should not be passed to another thread. + + Each iterator object supports the common interface: + - dereference operators: + @code + value_type [const] * operator ->() noexcept + value_type [const] & operator *() noexcept + @endcode + - pre-increment and pre-decrement. Post-operators is not supported + - equality operators == and !=. Iterators are equal iff they point to the same cell of the same array node. - Note that for two iterators \p it1 and \p it2, the conditon it1 == it2 + Note that for two iterators \p it1 and \p it2, the conditon it1 == it2 does not entail &(*it1) == &(*it2) : welcome to concurrent containers - - helper member function \p release() that clears internal hazard pointer. + - helper member function \p release() that clears internal hazard pointer. After \p release() call the iterator points to \p nullptr but it still remain valid: further iterating is possible. */ ///@{ @@ -993,19 +993,19 @@ namespace cds { namespace intrusive { return const_iterator( *this, m_Head, size_t(0) - 1 ); } - /// Returns an iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. + /// Returns an iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. iterator end() { return iterator( *this, m_Head, head_size(), false ); } - /// Returns a const iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. + /// Returns a const iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. const_iterator end() const { return const_iterator( *this, m_Head, head_size(), false ); } - /// Returns a const iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. + /// Returns a const iterator to the element following the last element of the set. This element acts as a placeholder; attempting to access it results in undefined behavior. const_iterator cend() { return const_iterator( *this, m_Head, head_size(), false ); @@ -1031,8 +1031,8 @@ namespace cds { namespace intrusive { /// Returns a reverse iterator to the element following the last element of the reversed set /** - It corresponds to the element preceding the first element of the non-reversed container. - This element acts as a placeholder, attempting to access it results in undefined behavior. + It corresponds to the element preceding the first element of the non-reversed container. + This element acts as a placeholder, attempting to access it results in undefined behavior. */ reverse_iterator rend() { @@ -1041,8 +1041,8 @@ namespace cds { namespace intrusive { /// Returns a const reverse iterator to the element following the last element of the reversed set /** - It corresponds to the element preceding the first element of the non-reversed container. - This element acts as a placeholder, attempting to access it results in undefined behavior. + It corresponds to the element preceding the first element of the non-reversed container. + This element acts as a placeholder, attempting to access it results in undefined behavior. */ const_reverse_iterator rend() const { @@ -1051,8 +1051,8 @@ namespace cds { namespace intrusive { /// Returns a const reverse iterator to the element following the last element of the reversed set /** - It corresponds to the element preceding the first element of the non-reversed container. - This element acts as a placeholder, attempting to access it results in undefined behavior. + It corresponds to the element preceding the first element of the non-reversed container. + This element acts as a placeholder, attempting to access it results in undefined behavior. */ const_reverse_iterator crend() { @@ -1204,7 +1204,7 @@ namespace cds { namespace intrusive { node_ptr cur(current.ptr()); atomic_node_ptr& slot = pParent->nodes[idxParent]; - if ( !slot.compare_exchange_strong( cur, cur | flag_array_converting, memory_model::memory_order_release, atomics::memory_order_relaxed )) + if ( !slot.compare_exchange_strong( cur, cur | flag_array_converting, memory_model::memory_order_release, atomics::memory_order_relaxed )) { m_Stat.onExpandNodeFailed(); free_array_node( pArr ); @@ -1214,7 +1214,7 @@ namespace cds { namespace intrusive { pArr->nodes[idx].store( current, memory_model::memory_order_release ); cur = cur | flag_array_converting; - CDS_VERIFY( + CDS_VERIFY( slot.compare_exchange_strong( cur, node_ptr( to_node( pArr ), flag_array_node ), memory_model::memory_order_release, atomics::memory_order_relaxed ) ); diff --git a/cds/intrusive/mspriority_queue.h b/cds/intrusive/mspriority_queue.h index 8c7f4d94..422bdd20 100644 --- a/cds/intrusive/mspriority_queue.h +++ b/cds/intrusive/mspriority_queue.h @@ -235,7 +235,7 @@ namespace cds { namespace intrusive { no item has been added. Otherwise, the function inserts the pointer to \p val into the heap and returns \p true. - + The function does not make a copy of \p val. */ bool push( value_type& val ) diff --git a/cds/intrusive/split_list.h b/cds/intrusive/split_list.h index 0be790d3..daba41df 100644 --- a/cds/intrusive/split_list.h +++ b/cds/intrusive/split_list.h @@ -478,7 +478,7 @@ namespace cds { namespace intrusive { if ( nMaxCount < max_item_count( nBucketCount, nLoadFactor )) return; // someone already have updated m_nBucketCountLog2, so stop here - m_nMaxItemCount.compare_exchange_strong( nMaxCount, max_item_count( nBucketCount << 1, nLoadFactor ), + m_nMaxItemCount.compare_exchange_strong( nMaxCount, max_item_count( nBucketCount << 1, nLoadFactor ), memory_model::memory_order_relaxed, atomics::memory_order_relaxed ); m_nBucketCountLog2.compare_exchange_strong( sz, sz + 1, memory_model::memory_order_relaxed, atomics::memory_order_relaxed ); } diff --git a/cds/intrusive/split_list_nogc.h b/cds/intrusive/split_list_nogc.h index 71d258c0..d0a7ef95 100644 --- a/cds/intrusive/split_list_nogc.h +++ b/cds/intrusive/split_list_nogc.h @@ -275,7 +275,7 @@ namespace cds { namespace intrusive { if ( nMaxCount < max_item_count( nBucketCount, nLoadFactor )) return; // someone already have updated m_nBucketCountLog2, so stop here - m_nMaxItemCount.compare_exchange_strong( nMaxCount, max_item_count( nBucketCount << 1, nLoadFactor ), + m_nMaxItemCount.compare_exchange_strong( nMaxCount, max_item_count( nBucketCount << 1, nLoadFactor ), memory_model::memory_order_relaxed, atomics::memory_order_relaxed ); m_nBucketCountLog2.compare_exchange_strong( sz, sz + 1, memory_model::memory_order_relaxed, atomics::memory_order_relaxed ); } diff --git a/cds/intrusive/split_list_rcu.h b/cds/intrusive/split_list_rcu.h index 71afda51..f26a253f 100644 --- a/cds/intrusive/split_list_rcu.h +++ b/cds/intrusive/split_list_rcu.h @@ -373,7 +373,7 @@ namespace cds { namespace intrusive { if ( nMaxCount < max_item_count( nBucketCount, nLoadFactor )) return; // someone already have updated m_nBucketCountLog2, so stop here - m_nMaxItemCount.compare_exchange_strong( nMaxCount, max_item_count( nBucketCount << 1, nLoadFactor ), + m_nMaxItemCount.compare_exchange_strong( nMaxCount, max_item_count( nBucketCount << 1, nLoadFactor ), memory_model::memory_order_relaxed, atomics::memory_order_relaxed ); m_nBucketCountLog2.compare_exchange_strong( sz, sz + 1, memory_model::memory_order_relaxed, atomics::memory_order_relaxed ); } diff --git a/cds/intrusive/treiber_stack.h b/cds/intrusive/treiber_stack.h index aac61cd2..b3dcfd56 100644 --- a/cds/intrusive/treiber_stack.h +++ b/cds/intrusive/treiber_stack.h @@ -745,7 +745,7 @@ namespace cds { namespace intrusive { } while ( true ) { - node_type * t = guard.protect( m_Top, + node_type * t = guard.protect( m_Top, []( node_type * p ) -> value_type * { return node_traits::to_value_ptr( p ); }); diff --git a/cds/memory/vyukov_queue_pool.h b/cds/memory/vyukov_queue_pool.h index edd75f03..bd723864 100644 --- a/cds/memory/vyukov_queue_pool.h +++ b/cds/memory/vyukov_queue_pool.h @@ -181,7 +181,7 @@ namespace cds { namespace memory { if ( p ) { if ( from_pool(p) ) { // The queue can notify about false fullness state - // so we push in loop + // so we push in loop back_off bkoff; while ( !m_Queue.push( *p )) bkoff(); diff --git a/cds/opt/compare.h b/cds/opt/compare.h index a377186c..24e5775e 100644 --- a/cds/opt/compare.h +++ b/cds/opt/compare.h @@ -185,11 +185,11 @@ namespace cds { namespace opt { template - using make_comparator = make_comparator_from< T, Traits, - typename std::conditional< - Forced, - make_comparator_from_less< std::less>, - opt::none + using make_comparator = make_comparator_from< T, Traits, + typename std::conditional< + Forced, + make_comparator_from_less< std::less>, + opt::none >::type >; template @@ -297,7 +297,7 @@ namespace cds { namespace opt { opt::none >::type, make_equal_to_from_less< less > >::type, make_equal_to_from_compare< compare > >::type, - equal_to + equal_to >::type type; }; } diff --git a/cds/os/alloc_aligned.h b/cds/os/alloc_aligned.h index 1b285978..aa12313e 100644 --- a/cds/os/alloc_aligned.h +++ b/cds/os/alloc_aligned.h @@ -141,7 +141,7 @@ namespace cds { sizeof(T) % nAlign == 0 \endcode - The function, like operator \p new does not return \p nullptr. + The function, like operator \p new does not return \p nullptr. In no memory situation the function throws \p std::bad_alloc exception. */ pointer allocate( size_type nAlign, size_type nCount ) diff --git a/cds/sync/injecting_monitor.h b/cds/sync/injecting_monitor.h index 323866e8..1c81327d 100644 --- a/cds/sync/injecting_monitor.h +++ b/cds/sync/injecting_monitor.h @@ -19,7 +19,7 @@ namespace cds { namespace sync { /// @ref cds_sync_monitor "Monitor" that injects the lock into each node /** - This simple monitor injects the lock object of type \p Lock into each node. + This simple monitor injects the lock object of type \p Lock into each node. The monitor is designed for user-space locking primitives like \ref sync::spin_lock "spin-lock". Template arguments: @@ -66,7 +66,7 @@ namespace cds { namespace sync { /// Scoped lock template - using scoped_lock = monitor_scoped_lock< injecting_monitor, Node > ; + using scoped_lock = monitor_scoped_lock< injecting_monitor, Node >; }; }} // namespace cds::sync diff --git a/cds/sync/pool_monitor.h b/cds/sync/pool_monitor.h index 19e22e8e..21b94a28 100644 --- a/cds/sync/pool_monitor.h +++ b/cds/sync/pool_monitor.h @@ -43,7 +43,7 @@ namespace cds { namespace sync { //@cond void onLock() - { + { ++m_nLockCount; int nDiff = static_cast( m_nLockCount.get() - m_nUnlockCount.get()); if ( nDiff > 0 && m_nMaxLocked.get() < static_cast( nDiff )) @@ -53,8 +53,8 @@ namespace cds { namespace sync { void onLockContention() { ++m_nLockContention; } void onUnlockContention() { ++m_nUnlockContention;} void onLockAllocation() - { - ++m_nLockAllocation; + { + ++m_nLockAllocation; int nDiff = static_cast( m_nLockAllocation.get() - m_nLockDeallocation.get()); if ( nDiff > 0 && m_nMaxAllocated.get() < static_cast( nDiff ) ) m_nMaxAllocated = static_cast( nDiff ); @@ -70,7 +70,7 @@ namespace cds { namespace sync { The monitor is intended for reducing the number of system mutexes for huge containers like a tree. The monitor allocates the mutex from the pool \p LockPool only when container's node should be locked. Lifetime of node's mutex is managed by - reference counter. When the reference counter to node's mutex becomes zero, + reference counter. When the reference counter to node's mutex becomes zero, the mutex is given back to the pool. The monitor is blocked: the access to node's mutex is performed under the spin-lock. @@ -94,18 +94,18 @@ namespace cds { namespace sync { public: typedef LockPool pool_type; ///< Pool type typedef typename pool_type::value_type lock_type; ///< node lock type - typedef typename std::conditional< - std::is_same< BackOff, cds::opt::none >::value, + typedef typename std::conditional< + std::is_same< BackOff, cds::opt::none >::value, cds::backoff::yield, BackOff >::type back_off; ///< back-off strategy for spinning typedef uint32_t refspin_type; ///< Reference counter + spin-lock bit /// Internal statistics - typedef typename std::conditional< - Stat, - typename pool_monitor_traits::stat<>, - typename pool_monitor_traits::empty_stat + typedef typename std::conditional< + Stat, + typename pool_monitor_traits::stat<>, + typename pool_monitor_traits::empty_stat >::type internal_stat; /// Pool's default capacity @@ -167,7 +167,7 @@ namespace cds { namespace sync { // try lock spin and increment reference counter refspin_type cur = p.m_SyncMonitorInjection.m_RefSpin.load( atomics::memory_order_relaxed ) & ~c_nSpinBit; if ( !p.m_SyncMonitorInjection.m_RefSpin.compare_exchange_weak( cur, cur + c_nRefIncrement + c_nSpinBit, - atomics::memory_order_acquire, atomics::memory_order_relaxed ) ) + atomics::memory_order_acquire, atomics::memory_order_relaxed ) ) { back_off bkoff; do { @@ -208,7 +208,7 @@ namespace cds { namespace sync { // try lock spin refspin_type cur = p.m_SyncMonitorInjection.m_RefSpin.load( atomics::memory_order_relaxed ) & ~c_nSpinBit; if ( !p.m_SyncMonitorInjection.m_RefSpin.compare_exchange_weak( cur, cur | c_nSpinBit, - atomics::memory_order_acquire, atomics::memory_order_relaxed ) ) + atomics::memory_order_acquire, atomics::memory_order_relaxed ) ) { back_off bkoff; do { @@ -245,7 +245,7 @@ namespace cds { namespace sync { /** If class' template argument \p Stat is \p false, the function returns \ref pool_monitor_traits::empty_stat "dummy statistics". - Otherwise, it returns the reference to monitor's internal statistics + Otherwise, it returns the reference to monitor's internal statistics of type \ref pool_monitor_traits::stat. */ internal_stat const& statistics() const diff --git a/src/hp_gc.cpp b/src/hp_gc.cpp index 4d9efec9..eb7a1152 100644 --- a/src/hp_gc.cpp +++ b/src/hp_gc.cpp @@ -324,7 +324,7 @@ namespace cds { namespace gc { // TSan can issue a warning here: // read src.m_nSize in src.end() - // write src.m_nSize in src.clear() + // write src.m_nSize in src.clear() // This is false positive since we own hprec CDS_TSAN_ANNOTATE_IGNORE_READS_BEGIN; details::retired_vector::iterator itRetiredEnd = src.end(); diff --git a/tests/cppunit/cppunit_mini.h b/tests/cppunit/cppunit_mini.h index 56e1897e..7ca40700 100644 --- a/tests/cppunit/cppunit_mini.h +++ b/tests/cppunit/cppunit_mini.h @@ -83,7 +83,7 @@ namespace CppUnitMini unsigned int getUInt( const char * pszParamName, unsigned int nDefVal = 0 ) const { return get( pszParamName, nDefVal ) ; } long getLong( const char * pszParamName, long nDefVal = 0 ) const { return get( pszParamName, nDefVal ) ; } unsigned long getULong( const char * pszParamName, unsigned long nDefVal = 0 ) const { return get( pszParamName, nDefVal ) ; } - size_t getSizeT( const char * pszParamName, size_t nDefVal = 0 ) const + size_t getSizeT( const char * pszParamName, size_t nDefVal = 0 ) const { return static_cast( getULong( pszParamName, static_cast(nDefVal))); } diff --git a/tests/cppunit/test_main.cpp b/tests/cppunit/test_main.cpp index c99fe5a3..7f418671 100644 --- a/tests/cppunit/test_main.cpp +++ b/tests/cppunit/test_main.cpp @@ -120,7 +120,7 @@ namespace CppUnitMini } bool TestCase::shouldRunThis(const char *in_desiredTest, const char *in_className, const char *in_functionName, - bool invert, bool explicit_test, bool &do_progress) + bool invert, bool explicit_test, bool &do_progress) { if ((in_desiredTest) && (in_desiredTest[0] != '\0')) { do_progress = false; diff --git a/tests/test-hdr/list/hdr_intrusive_michael_list_rcu_gpi.cpp b/tests/test-hdr/list/hdr_intrusive_michael_list_rcu_gpi.cpp index a19b9821..b107be88 100644 --- a/tests/test-hdr/list/hdr_intrusive_michael_list_rcu_gpi.cpp +++ b/tests/test-hdr/list/hdr_intrusive_michael_list_rcu_gpi.cpp @@ -65,7 +65,7 @@ namespace ordlist { void IntrusiveMichaelListHeaderTest::RCU_GPI_member_cmp() { typedef member_int_item< RCU > item; - struct traits: public + struct traits: public ci::michael_list::make_traits< ci::opt::hook< ci::michael_list::member_hook< offsetof( item, hMember ), @@ -81,7 +81,7 @@ namespace ordlist { void IntrusiveMichaelListHeaderTest::RCU_GPI_member_less() { typedef member_int_item< RCU > item; - struct traits: public + struct traits: public ci::michael_list::make_traits< ci::opt::hook< ci::michael_list::member_hook< offsetof( item, hMember ), @@ -97,7 +97,7 @@ namespace ordlist { void IntrusiveMichaelListHeaderTest::RCU_GPI_member_cmpmix() { typedef member_int_item< RCU > item; - struct traits: public + struct traits: public ci::michael_list::make_traits< ci::opt::hook< ci::michael_list::member_hook< offsetof( item, hMember ), @@ -114,7 +114,7 @@ namespace ordlist { void IntrusiveMichaelListHeaderTest::RCU_GPI_member_ic() { typedef member_int_item< RCU > item; - struct traits: public + struct traits: public ci::michael_list::make_traits< ci::opt::hook< ci::michael_list::member_hook< offsetof( item, hMember ), diff --git a/tests/test-hdr/list/hdr_lazy.h b/tests/test-hdr/list/hdr_lazy.h index 84f25544..e7fb9bb6 100644 --- a/tests/test-hdr/list/hdr_lazy.h +++ b/tests/test-hdr/list/hdr_lazy.h @@ -945,4 +945,4 @@ namespace ordlist { } // namespace ordlist -#endif // #ifndef CDSTEST_HDR_LAZY_H \ No newline at end of file +#endif // #ifndef CDSTEST_HDR_LAZY_H diff --git a/tests/test-hdr/list/hdr_lazy_kv.h b/tests/test-hdr/list/hdr_lazy_kv.h index 4752625d..4eeef280 100644 --- a/tests/test-hdr/list/hdr_lazy_kv.h +++ b/tests/test-hdr/list/hdr_lazy_kv.h @@ -930,4 +930,4 @@ namespace ordlist { } // namespace ordlist -#endif // #ifndef CDSTEST_HDR_LAZY_KV_H \ No newline at end of file +#endif // #ifndef CDSTEST_HDR_LAZY_KV_H diff --git a/tests/test-hdr/map/hdr_multilevel_hashmap.h b/tests/test-hdr/map/hdr_multilevel_hashmap.h index 1940486e..d8f0a05c 100644 --- a/tests/test-hdr/map/hdr_multilevel_hashmap.h +++ b/tests/test-hdr/map/hdr_multilevel_hashmap.h @@ -6,7 +6,7 @@ #include "cppunit/cppunit_proxy.h" // forward declaration -namespace cds { +namespace cds { namespace container {} namespace opt {} } @@ -114,9 +114,9 @@ namespace map { CPPUNIT_ASSERT(m.contains( key )); CPPUNIT_ASSERT(m.size() == i + 1); - auto ret = m.update(key, [] ( value_type& v, value_type * old ) { + auto ret = m.update(key, [] ( value_type& v, value_type * old ) { CPPUNIT_ASSERT_CURRENT( old != nullptr ); - ++v.second.nInsertCall; + ++v.second.nInsertCall; }, false ); CPPUNIT_ASSERT( ret.first ); CPPUNIT_ASSERT( !ret.second ); @@ -152,7 +152,7 @@ namespace map { ++nCount; } CPPUNIT_ASSERT( nCount == capacity ); - + nCount = 0; for ( auto it = m.cbegin(), itEnd = m.cend(); it != itEnd; ++it ) { CPPUNIT_ASSERT( it->second.nInsertCall == 1 ); diff --git a/tests/test-hdr/set/hdr_intrusive_multilevel_hashset.h b/tests/test-hdr/set/hdr_intrusive_multilevel_hashset.h index a17823b9..d9622334 100644 --- a/tests/test-hdr/set/hdr_intrusive_multilevel_hashset.h +++ b/tests/test-hdr/set/hdr_intrusive_multilevel_hashset.h @@ -6,7 +6,7 @@ #include "cppunit/cppunit_proxy.h" // forward declaration -namespace cds { +namespace cds { namespace intrusive {} namespace opt {} } diff --git a/tests/test-hdr/set/hdr_intrusive_multilevel_hashset_dhp.cpp b/tests/test-hdr/set/hdr_intrusive_multilevel_hashset_dhp.cpp index be6511f6..e78f35a2 100644 --- a/tests/test-hdr/set/hdr_intrusive_multilevel_hashset_dhp.cpp +++ b/tests/test-hdr/set/hdr_intrusive_multilevel_hashset_dhp.cpp @@ -22,9 +22,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(4, 2); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -47,9 +47,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" ); test_hp(4, 2); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -73,9 +73,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(4, 2); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -100,9 +100,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 2); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -126,9 +126,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(5, 3); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -151,9 +151,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 3); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -177,9 +177,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(5, 3); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -205,9 +205,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 3); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > diff --git a/tests/test-hdr/set/hdr_intrusive_multilevel_hashset_hp.cpp b/tests/test-hdr/set/hdr_intrusive_multilevel_hashset_hp.cpp index d46bdc0f..36ae475a 100644 --- a/tests/test-hdr/set/hdr_intrusive_multilevel_hashset_hp.cpp +++ b/tests/test-hdr/set/hdr_intrusive_multilevel_hashset_hp.cpp @@ -22,9 +22,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(4, 2); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -47,9 +47,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" ); test_hp(4, 2); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -73,9 +73,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(4, 2); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -100,9 +100,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 2); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -126,9 +126,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(5, 3); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -151,9 +151,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 3); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -177,9 +177,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(5, 3); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > @@ -205,9 +205,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 3); - typedef ci::MultiLevelHashSet< - gc_type, - Item, + typedef ci::MultiLevelHashSet< + gc_type, + Item, typename ci::multilevel_hashset::make_traits< ci::multilevel_hashset::hash_accessor< get_hash> , ci::opt::disposer< item_disposer > diff --git a/tests/test-hdr/set/hdr_intrusive_set.h b/tests/test-hdr/set/hdr_intrusive_set.h index 0355e7d3..fc3c48bc 100644 --- a/tests/test-hdr/set/hdr_intrusive_set.h +++ b/tests/test-hdr/set/hdr_intrusive_set.h @@ -1968,4 +1968,4 @@ namespace set { } // namespace set -#endif // #ifndef CDSTEST_HDR_INTRUSIVE_SET_H \ No newline at end of file +#endif // #ifndef CDSTEST_HDR_INTRUSIVE_SET_H diff --git a/tests/test-hdr/set/hdr_multilevel_hashset.h b/tests/test-hdr/set/hdr_multilevel_hashset.h index 649a18a4..24a5989c 100644 --- a/tests/test-hdr/set/hdr_multilevel_hashset.h +++ b/tests/test-hdr/set/hdr_multilevel_hashset.h @@ -6,7 +6,7 @@ #include "cppunit/cppunit_proxy.h" // forward declaration -namespace cds { +namespace cds { namespace container {} namespace opt {} } @@ -162,8 +162,8 @@ namespace set { for ( size_t i = 0; i < capacity; ++i ) { hash_type h = hasher(i); CPPUNIT_ASSERT( s.contains( h )); - std::pair ret = s.update( arg_type( i, h ), - [](value_type& i, value_type * prev ) { + std::pair ret = s.update( arg_type( i, h ), + [](value_type& i, value_type * prev ) { CPPUNIT_ASSERT_CURRENT( prev != nullptr ); CPPUNIT_ASSERT_CURRENT( i.key == prev->key ); CPPUNIT_ASSERT_CURRENT( i.hash == prev->hash ); @@ -262,11 +262,11 @@ namespace set { size_t nSum = 0; for ( size_t i = 1; i <= capacity; ++i ) { CPPUNIT_ASSERT( s.size() == capacity - i + 1 ); - CPPUNIT_ASSERT(s.erase(hasher(i), [&nSum]( value_type const& val ) { + CPPUNIT_ASSERT(s.erase(hasher(i), [&nSum]( value_type const& val ) { CPPUNIT_ASSERT_CURRENT( val.nInsertCall == 1 ); CPPUNIT_ASSERT_CURRENT( val.nFindCall == 4 ); CPPUNIT_ASSERT_CURRENT( val.nIteratorCall == 2 ); - nSum += val.key; + nSum += val.key; } )) CPPUNIT_ASSERT( s.size() == capacity - i ); CPPUNIT_ASSERT( !s.erase(hasher(i), [&nSum]( value_type const& val ) { nSum += val.key; } )) @@ -281,8 +281,8 @@ namespace set { CPPUNIT_ASSERT( !s.contains( h )); guarded_ptr gp(s.get( h )); CPPUNIT_ASSERT( !gp ); - std::pair ret = s.update( arg_type( i, h ), - [](value_type& i, value_type * prev ) { + std::pair ret = s.update( arg_type( i, h ), + [](value_type& i, value_type * prev ) { CPPUNIT_ASSERT_CURRENT( prev == nullptr ); i.nInsertCall += 1; }); diff --git a/tests/test-hdr/set/hdr_multilevel_hashset_dhp.cpp b/tests/test-hdr/set/hdr_multilevel_hashset_dhp.cpp index 5ce8d55d..9e089e01 100644 --- a/tests/test-hdr/set/hdr_multilevel_hashset_dhp.cpp +++ b/tests/test-hdr/set/hdr_multilevel_hashset_dhp.cpp @@ -21,9 +21,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(4, 2); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> >::type @@ -44,9 +44,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" ); test_hp(4, 2); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> , co::less< hash_type::less > @@ -68,9 +68,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(4, 2); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> ,co::stat< cc::multilevel_hashset::stat<>> @@ -93,9 +93,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 2); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> ,co::stat< cc::multilevel_hashset::stat<>> @@ -117,9 +117,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(5, 3); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> >::type @@ -140,9 +140,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 3); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> ,co::memory_model< co::v::sequential_consistent > @@ -164,9 +164,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(5, 3); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> ,co::stat< cc::multilevel_hashset::stat<>> @@ -190,9 +190,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 3); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> , co::stat< cc::multilevel_hashset::stat<>> diff --git a/tests/test-hdr/set/hdr_multilevel_hashset_hp.cpp b/tests/test-hdr/set/hdr_multilevel_hashset_hp.cpp index e96b3c43..5ee89c4f 100644 --- a/tests/test-hdr/set/hdr_multilevel_hashset_hp.cpp +++ b/tests/test-hdr/set/hdr_multilevel_hashset_hp.cpp @@ -21,9 +21,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(4, 2); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> >::type @@ -44,9 +44,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" ); test_hp(4, 2); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> , co::less< hash_type::less > @@ -68,9 +68,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(4, 2); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> ,co::stat< cc::multilevel_hashset::stat<>> @@ -93,9 +93,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 2); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> ,co::stat< cc::multilevel_hashset::stat<>> @@ -117,9 +117,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(5, 3); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> >::type @@ -140,9 +140,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 3); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> ,co::memory_model< co::v::sequential_consistent > @@ -164,9 +164,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" ); test_hp>(5, 3); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> ,co::stat< cc::multilevel_hashset::stat<>> @@ -190,9 +190,9 @@ namespace set { static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" ); test_hp(4, 3); - typedef cc::MultiLevelHashSet< - gc_type, - Item, + typedef cc::MultiLevelHashSet< + gc_type, + Item, typename cc::multilevel_hashset::make_traits< cc::multilevel_hashset::hash_accessor< get_hash> , co::stat< cc::multilevel_hashset::stat<>> diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map.h b/tests/test-hdr/tree/hdr_bronson_avltree_map.h index 7db25747..785256c1 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map.h +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map.h @@ -231,10 +231,10 @@ namespace tree { CPPUNIT_ASSERT( f.m_found.stat.nEnsureNewFuncCall == 0 ); } - ensureResult = s.update( 13, []( bool /*bNew*/, key_type key, value_type& v ) - { - v.nVal = key * 1000; - ++v.stat.nEnsureNewFuncCall; + ensureResult = s.update( 13, []( bool /*bNew*/, key_type key, value_type& v ) + { + v.nVal = key * 1000; + ++v.stat.nEnsureNewFuncCall; }); CPPUNIT_ASSERT( ensureResult.first && ensureResult.second ); CPPUNIT_ASSERT( !s.empty() ); @@ -391,7 +391,7 @@ namespace tree { xp = s.extract_max(); CPPUNIT_ASSERT( xp ); nPrev = xp->nVal; - CPPUNIT_CHECK_EX( nPrev == c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1), + CPPUNIT_CHECK_EX( nPrev == c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1), "Expected=" << c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1) << " real=" << nPrev ); while ( !s.empty() ) { xp = s.extract_max(); @@ -411,9 +411,9 @@ namespace tree { xp = s.extract_max( [&keyPrev]( key_type k ){ keyPrev = k; }); CPPUNIT_ASSERT( xp ); nPrev = xp->nVal; - CPPUNIT_CHECK_EX( keyPrev == sizeof(keys) / sizeof(keys[0]) - 1, + CPPUNIT_CHECK_EX( keyPrev == sizeof(keys) / sizeof(keys[0]) - 1, "Expected=" << sizeof(keys) / sizeof(keys[0]) - 1 << " real=" << keyPrev ); - CPPUNIT_CHECK_EX( nPrev == c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1), + CPPUNIT_CHECK_EX( nPrev == c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1), "Expected=" << c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1) << " real=" << nPrev ); while ( !s.empty() ) { xp = s.extract_max( [&key](key_type k){ key = k; }); @@ -435,9 +435,9 @@ namespace tree { xp = s.extract_max_key( keyPrev ); CPPUNIT_ASSERT( xp ); nPrev = xp->nVal; - CPPUNIT_CHECK_EX( keyPrev == sizeof(keys) / sizeof(keys[0]) - 1, + CPPUNIT_CHECK_EX( keyPrev == sizeof(keys) / sizeof(keys[0]) - 1, "Expected=" << sizeof(keys) / sizeof(keys[0]) - 1 << " real=" << keyPrev ); - CPPUNIT_CHECK_EX( nPrev == c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1), + CPPUNIT_CHECK_EX( nPrev == c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1), "Expected=" << c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1) << " real=" << nPrev ); while ( !s.empty() ) { xp = s.extract_max_key( key ); diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpb.cpp b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpb.cpp index 37a71809..73792b53 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpb.cpp +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpb.cpp @@ -23,7 +23,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_less() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< false > @@ -35,7 +35,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_less_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > @@ -48,7 +48,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmp() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > >::type @@ -59,7 +59,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmp_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::stat< cc::bronson_avltree::stat<> > @@ -71,7 +71,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmpless() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::less< std::less > @@ -83,7 +83,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_less_ic() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::item_counter< cds::atomicity::item_counter > @@ -95,7 +95,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmp_ic() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -107,7 +107,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmp_ic_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -120,7 +120,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmp_ic_stat_yield() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -134,7 +134,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_less_relaxed_insert() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< true > @@ -146,7 +146,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_less_relaxed_insert_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpb_pool_monitor.cpp b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpb_pool_monitor.cpp index d4a806a8..52af9276 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpb_pool_monitor.cpp +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpb_pool_monitor.cpp @@ -31,7 +31,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_less() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::sync_monitor< cds::sync::pool_monitor > @@ -43,7 +43,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_less_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > @@ -57,7 +57,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_cmp_ic_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -71,7 +71,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_cmp_ic_stat_yield() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -86,7 +86,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_less_relaxed_insert() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< true > @@ -99,7 +99,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_less_relaxed_insert_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpi.cpp b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpi.cpp index f8be4e06..4a230377 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpi.cpp +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpi.cpp @@ -23,7 +23,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_less() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< false > @@ -35,7 +35,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_less_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > @@ -48,7 +48,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmp() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > >::type @@ -59,7 +59,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmp_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::stat< cc::bronson_avltree::stat<> > @@ -71,7 +71,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmpless() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::less< std::less > @@ -83,7 +83,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_less_ic() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::item_counter< cds::atomicity::item_counter > @@ -95,7 +95,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmp_ic() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -107,7 +107,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmp_ic_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -120,7 +120,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmp_ic_stat_yield() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -134,7 +134,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_less_relaxed_insert() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< true > @@ -146,7 +146,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_less_relaxed_insert_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpi_pool_monitor.cpp b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpi_pool_monitor.cpp index 73bfa58b..2bffabe4 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpi_pool_monitor.cpp +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpi_pool_monitor.cpp @@ -31,7 +31,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_less() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::sync_monitor< cds::sync::pool_monitor > @@ -43,7 +43,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_less_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > @@ -57,7 +57,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_cmp_ic_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -71,7 +71,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_cmp_ic_stat_yield() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -86,7 +86,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_less_relaxed_insert() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< true > @@ -99,7 +99,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_less_relaxed_insert_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpt.cpp b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpt.cpp index c67649cc..5107764d 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpt.cpp +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpt.cpp @@ -23,7 +23,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_less() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< false > @@ -35,7 +35,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_less_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > @@ -48,7 +48,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmp() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > >::type @@ -59,7 +59,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmp_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::stat< cc::bronson_avltree::stat<> > @@ -71,7 +71,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmpless() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::less< std::less > @@ -83,7 +83,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_less_ic() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::item_counter< cds::atomicity::item_counter > @@ -95,7 +95,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmp_ic() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -107,7 +107,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmp_ic_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -120,7 +120,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmp_ic_stat_yield() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -134,7 +134,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_less_relaxed_insert() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< true > @@ -146,7 +146,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_less_relaxed_insert_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpt_pool_monitor.cpp b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpt_pool_monitor.cpp index 839a1c68..5f7520b2 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpt_pool_monitor.cpp +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpt_pool_monitor.cpp @@ -32,7 +32,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_less() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::sync_monitor< cds::sync::pool_monitor > @@ -44,7 +44,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_less_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > @@ -58,7 +58,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_cmp_ic_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -72,7 +72,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_cmp_ic_stat_yield() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -87,7 +87,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_less_relaxed_insert() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< true > @@ -100,7 +100,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_less_relaxed_insert_stat() { - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_shb.cpp b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_shb.cpp index f4cd4ad5..ea459bb8 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_shb.cpp +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_shb.cpp @@ -26,7 +26,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_less() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< false > @@ -40,7 +40,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_less_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > @@ -55,7 +55,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmp() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > >::type @@ -68,7 +68,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmp_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::stat< cc::bronson_avltree::stat<> > @@ -82,7 +82,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmpless() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::less< std::less > @@ -96,7 +96,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_less_ic() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::item_counter< cds::atomicity::item_counter > @@ -110,7 +110,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmp_ic() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -124,7 +124,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmp_ic_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -139,7 +139,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmp_ic_stat_yield() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -155,7 +155,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_less_relaxed_insert() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< true > @@ -169,7 +169,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_less_relaxed_insert_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_shb_pool_monitor.cpp b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_shb_pool_monitor.cpp index ac9b4b7b..1e097fea 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_shb_pool_monitor.cpp +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_shb_pool_monitor.cpp @@ -34,7 +34,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_less() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::sync_monitor< cds::sync::pool_monitor > @@ -48,7 +48,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_less_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > @@ -64,7 +64,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_cmp_ic_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -80,7 +80,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_cmp_ic_stat_yield() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -97,7 +97,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_less_relaxed_insert() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< true > @@ -112,7 +112,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_less_relaxed_insert_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_sht.cpp b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_sht.cpp index 44fb3cfa..a108774c 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_sht.cpp +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_sht.cpp @@ -26,7 +26,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_less() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< false > @@ -40,7 +40,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_less_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > @@ -55,7 +55,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmp() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > >::type @@ -68,7 +68,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmp_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::stat< cc::bronson_avltree::stat<> > @@ -82,7 +82,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmpless() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::less< std::less > @@ -96,7 +96,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_less_ic() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::item_counter< cds::atomicity::item_counter > @@ -110,7 +110,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmp_ic() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -124,7 +124,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmp_ic_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -139,7 +139,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmp_ic_stat_yield() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -155,7 +155,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_less_relaxed_insert() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< true > @@ -169,7 +169,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_less_relaxed_insert_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > diff --git a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_sht_pool_monitor.cpp b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_sht_pool_monitor.cpp index 6a3570e7..43ba760b 100644 --- a/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_sht_pool_monitor.cpp +++ b/tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_sht_pool_monitor.cpp @@ -34,7 +34,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_less() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::sync_monitor< cds::sync::pool_monitor > @@ -48,7 +48,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_less_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > @@ -64,7 +64,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_cmp_ic_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -80,7 +80,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_cmp_ic_stat_yield() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::compare< compare > ,co::item_counter< cds::atomicity::item_counter > @@ -97,7 +97,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_less_relaxed_insert() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,cc::bronson_avltree::relaxed_insert< true > @@ -112,7 +112,7 @@ namespace tree { void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_less_relaxed_insert_stat() { #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits: public + struct traits: public cc::bronson_avltree::make_traits< co::less< std::less > ,co::stat< cc::bronson_avltree::stat<> > diff --git a/tests/unit/map2/map_insdel_func.cpp b/tests/unit/map2/map_insdel_func.cpp index 6898d390..964b38e9 100644 --- a/tests/unit/map2/map_insdel_func.cpp +++ b/tests/unit/map2/map_insdel_func.cpp @@ -20,7 +20,7 @@ namespace map2 { size_t Map_InsDel_func::c_nMaxLoadFactor = def_nMaxLoadFactor; // maximum load factor bool Map_InsDel_func::c_bPrintGCState = true; - void Map_InsDel_func::setUpParams( const CppUnitMini::TestCfg& cfg ) + void Map_InsDel_func::setUpParams( const CppUnitMini::TestCfg& cfg ) { c_nInsertThreadCount = cfg.getULong("InsertThreadCount", def_nInsertThreadCount ); c_nDeleteThreadCount = cfg.getULong("DeleteThreadCount", def_nDeleteThreadCount ); diff --git a/tests/unit/map2/map_insdel_string.cpp b/tests/unit/map2/map_insdel_string.cpp index 7be437c2..bcfd00c0 100644 --- a/tests/unit/map2/map_insdel_string.cpp +++ b/tests/unit/map2/map_insdel_string.cpp @@ -12,7 +12,7 @@ namespace map2 { size_t Map_InsDel_string::c_nMaxLoadFactor = 8; bool Map_InsDel_string::c_bPrintGCState = true; - void Map_InsDel_string::setUpParams( const CppUnitMini::TestCfg& cfg ) + void Map_InsDel_string::setUpParams( const CppUnitMini::TestCfg& cfg ) { c_nInsertThreadCount = cfg.getSizeT("InsertThreadCount", c_nInsertThreadCount ); c_nDeleteThreadCount = cfg.getSizeT("DeleteThreadCount", c_nDeleteThreadCount ); diff --git a/tests/unit/map2/map_type_bronson_avltree.h b/tests/unit/map2/map_type_bronson_avltree.h index f765abb6..5296dfbd 100644 --- a/tests/unit/map2/map_type_bronson_avltree.h +++ b/tests/unit/map2/map_type_bronson_avltree.h @@ -25,7 +25,7 @@ namespace map2 { typedef cds::memory::lazy_vyukov_queue_pool< std::mutex > BronsonAVLTreeMap_lazy_pool; typedef cds::memory::bounded_vyukov_queue_pool< std::mutex > BronsonAVLTreeMap_bounded_pool; - struct BronsonAVLTreeMap_less: public + struct BronsonAVLTreeMap_less: public cc::bronson_avltree::make_traits< co::less< less > ,cc::bronson_avltree::relaxed_insert< false > @@ -39,7 +39,7 @@ namespace map2 { typedef cc::BronsonAVLTreeMap< rcu_shb, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_shb_less; typedef cc::BronsonAVLTreeMap< rcu_sht, Key, Value, BronsonAVLTreeMap_less > BronsonAVLTreeMap_rcu_sht_less; #endif - struct BronsonAVLTreeMap_cmp_stat: public + struct BronsonAVLTreeMap_cmp_stat: public cc::bronson_avltree::make_traits< co::compare< compare > ,cc::bronson_avltree::relaxed_insert< false > @@ -142,8 +142,8 @@ namespace map2 { { CPPUNIT_MSG( " Check internal consistency (single-threaded)..." ); bool bOk = m.check_consistency([]( size_t nLevel, size_t hLeft, size_t hRight ) - { - CPPUNIT_MSG( "Tree violation on level=" << nLevel << ": hLeft=" << hLeft << ", hRight=" << hRight ) + { + CPPUNIT_MSG( "Tree violation on level=" << nLevel << ": hLeft=" << hLeft << ", hRight=" << hRight ) }); CPPUNIT_CHECK_CURRENT_EX( bOk, "check_consistency failed"); } diff --git a/tests/unit/pqueue/pop.cpp b/tests/unit/pqueue/pop.cpp index 66becb02..41292bae 100644 --- a/tests/unit/pqueue/pop.cpp +++ b/tests/unit/pqueue/pop.cpp @@ -209,7 +209,7 @@ namespace pqueue { nTotalFailed += pThread->m_nPopFailed; } - CPPUNIT_MSG( " Total: popped=" << nTotalPopped << ", empty pop=" << nTotalFailed + CPPUNIT_MSG( " Total: popped=" << nTotalPopped << ", empty pop=" << nTotalFailed << "\n Errors: pop equal=" << nTotalErrorEq << ", priority violation=" << nTotalError ); CPPUNIT_CHECK( nTotalPopped == nThreadItemCount * s_nThreadCount ); diff --git a/tools/make_distrib.pl b/tools/make_distrib.pl index 1e9d9483..5ce0ad47 100644 --- a/tools/make_distrib.pl +++ b/tools/make_distrib.pl @@ -20,7 +20,7 @@ print "Clone git: repo=$GitRepo, branch=$GitBranch\n"; `git clone -b $GitBranch $GitRepo $DistrDir` or die "Error cloning branch $GitBranch to $DistrDir\n"; print "Remove $DistrDir/.git directory\n"; `rm -fr $DistrDir/.git`; -`rm -f $DistrDir/.gitignore $DistrDir/tools/brush_cds.pl $DistrDir/tools/make_distrib.pl $DistrDir/tools/make_distrib.bat`; +`rm -f $DistrDir/.gitignore $DistrDir/tools/brush_cds.pl $DistrDir/tools/make_distrib.pl $DistrDir/tools/make_distrib.bat $DistrDir/doxygen/images.odp`; print "make copyright...\n" ; makeCopyright($DistrDir); -- 2.34.1