From 6c73c197db28de65f8ef03f89aeb2bd5a491c337 Mon Sep 17 00:00:00 2001 From: khizmax Date: Thu, 8 Oct 2015 21:40:32 +0300 Subject: [PATCH] Some small optimizations --- cds/intrusive/impl/multilevel_hashset.h | 3 +-- cds/intrusive/multilevel_hashset_rcu.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) 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; } -- 2.34.1