FeldmanHashSet: added checking if a slot can be expanded
[libcds.git] / cds / intrusive / impl / feldman_hashset.h
index e2d387472679f6726a68bf249dd9fb135dd43cd8..68f4c66e205fbd0a44571020df49099d738e860b 100644 (file)
@@ -640,8 +640,12 @@ namespace cds { namespace intrusive {
                         return false;
                     }
 
-                    // the slot must be expanded
-                    base_class::expand_slot( pos, slot );
+                    if ( !pos.splitter.eos() ) {
+                        // the slot must be expanded
+                        base_class::expand_slot( pos, slot );
+                    }
+                    else
+                        return false;
                 }
                 else {
                     // the slot is empty, try to insert data node
@@ -1215,8 +1219,12 @@ namespace cds { namespace intrusive {
                     }
 
                     if ( bInsert ) {
-                        // the slot must be expanded
-                        base_class::expand_slot( pos, slot );
+                        if ( !pos.splitter.eos() ) {
+                            // the slot must be expanded
+                            base_class::expand_slot( pos, slot );
+                        }
+                        else
+                            return std::make_pair( false, false );
                     }
                     else {
                         stats().onUpdateFailed();