From: khizmax Date: Thu, 8 Oct 2015 18:40:32 +0000 (+0300) Subject: Some small optimizations X-Git-Tag: v2.1.0~91 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6c73c197db28de65f8ef03f89aeb2bd5a491c337;p=libcds.git Some small optimizations --- diff --git a/cds/intrusive/impl/multilevel_hashset.h b/cds/intrusive/impl/multilevel_hashset.h index 5c3c5455..edb7941f 100644 --- a/cds/intrusive/impl/multilevel_hashset.h +++ b/cds/intrusive/impl/multilevel_hashset.h @@ -1080,8 +1080,7 @@ namespace cds { namespace intrusive { static array_node * alloc_array_node( size_t nSize, array_node * pParent, size_t idxParent ) { array_node * pNode = cxx_array_node_allocator().NewBlock( sizeof(array_node) + sizeof(atomic_node_ptr) * (nSize - 1), pParent, idxParent ); - for ( atomic_node_ptr * p = pNode->nodes, *pEnd = pNode->nodes + nSize; p < pEnd; ++p ) - p->store( node_ptr(), memory_model::memory_order_release ); + new ( pNode->nodes ) atomic_node_ptr[ nSize ]; return pNode; } diff --git a/cds/intrusive/multilevel_hashset_rcu.h b/cds/intrusive/multilevel_hashset_rcu.h index 1c088612..accb6aa6 100644 --- a/cds/intrusive/multilevel_hashset_rcu.h +++ b/cds/intrusive/multilevel_hashset_rcu.h @@ -1285,8 +1285,7 @@ namespace cds { namespace intrusive { static array_node * alloc_array_node(size_t nSize, array_node * pParent, size_t idxParent) { array_node * pNode = cxx_array_node_allocator().NewBlock(sizeof(array_node) + sizeof(atomic_node_ptr) * (nSize - 1), pParent, idxParent); - for (atomic_node_ptr * p = pNode->nodes, *pEnd = pNode->nodes + nSize; p < pEnd; ++p) - p->store(node_ptr(), memory_model::memory_order_release); + new (pNode->nodes) atomic_node_ptr[nSize]; return pNode; }