Added more assertion
authorkhizmax <libcds.dev@gmail.com>
Wed, 23 Dec 2015 06:29:45 +0000 (09:29 +0300)
committerkhizmax <libcds.dev@gmail.com>
Wed, 23 Dec 2015 06:29:45 +0000 (09:29 +0300)
cds/algo/split_bitstring.h
cds/intrusive/details/feldman_hashset_base.h

index 37cf2804ca77f3a13683c37a8783d314a2d13184..660cebfacc85dd219c057cdb08a4c334d22edbfa 100644 (file)
@@ -133,6 +133,12 @@ namespace cds { namespace algo {
             m_pos = 0;
         }
 
+        // Returns pointer to source bitstring
+        bitstring const * source() const
+        {
+            return reinterpret_cast<bitstring const *>( m_first );
+        }
+
     private:
         //@cond
         uint_type const* m_ptr;  ///< current position in the hash
index 11abc4c5cd818a7c9c580241d2b6a50a38f72c07..97ca6de49241913ecc839e9233e2eee4654effce 100644 (file)
@@ -408,6 +408,7 @@ namespace cds { namespace intrusive {
                     if (slot.bits() == flag_array_node) {
                         // array node, go down the tree
                         assert(slot.ptr() != nullptr);
+                        assert( !pos.splitter.eos());
                         pos.nSlot = pos.splitter.cut( metrics().array_node_size_log );
                         assert( pos.nSlot < metrics().array_node_size );
                         pos.pArr = to_array(slot.ptr());
@@ -544,7 +545,7 @@ namespace cds { namespace intrusive {
                 }
             }
 
-            bool expand_slot( traverse_data& pos, node_ptr current)
+            bool expand_slot( traverse_data const& pos, node_ptr current)
             {
                 return expand_slot( pos.pArr, pos.nSlot, current, pos.nOffset );
             }