forked from boostorg/unordered
reduced insertion contention zone
This commit is contained in:
@ -1602,14 +1602,15 @@ private:
|
|||||||
/* slot wasn't empty */
|
/* slot wasn't empty */
|
||||||
goto startover;
|
goto startover;
|
||||||
}
|
}
|
||||||
|
auto p=this->arrays.elements()+pos*N+n;
|
||||||
|
this->construct_element(p,std::forward<Args>(args)...);
|
||||||
if(BOOST_UNLIKELY(
|
if(BOOST_UNLIKELY(
|
||||||
!insert_counter(pos0).compare_exchange_weak(counter,counter+1))){
|
!insert_counter(pos0).compare_exchange_weak(counter,counter+1))){
|
||||||
/* other thread inserted from pos0, need to start over */
|
/* other thread inserted from pos0, need to start over */
|
||||||
|
this->destroy_element(p);
|
||||||
pg->reset(n);
|
pg->reset(n);
|
||||||
goto startover;
|
goto startover;
|
||||||
}
|
}
|
||||||
auto p=this->arrays.elements()+pos*N+n;
|
|
||||||
this->construct_element(p,std::forward<Args>(args)...);
|
|
||||||
pg->set(n,hash);
|
pg->set(n,hash);
|
||||||
insert_counter(pos0)=counter+2;
|
insert_counter(pos0)=counter+2;
|
||||||
++local_garbage_vector().size;
|
++local_garbage_vector().size;
|
||||||
|
Reference in New Issue
Block a user