From: khizmax Date: Wed, 23 Dec 2015 06:29:45 +0000 (+0300) Subject: Added more assertion X-Git-Tag: v2.1.0~16 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=32f2e9288e99b81d42421c1b05d3dfcc1d9a0461;p=libcds.git Added more assertion --- diff --git a/cds/algo/split_bitstring.h b/cds/algo/split_bitstring.h index 37cf2804..660cebfa 100644 --- a/cds/algo/split_bitstring.h +++ b/cds/algo/split_bitstring.h @@ -133,6 +133,12 @@ namespace cds { namespace algo { m_pos = 0; } + // Returns pointer to source bitstring + bitstring const * source() const + { + return reinterpret_cast( m_first ); + } + private: //@cond uint_type const* m_ptr; ///< current position in the hash diff --git a/cds/intrusive/details/feldman_hashset_base.h b/cds/intrusive/details/feldman_hashset_base.h index 11abc4c5..97ca6de4 100644 --- a/cds/intrusive/details/feldman_hashset_base.h +++ b/cds/intrusive/details/feldman_hashset_base.h @@ -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 ); }