Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::concurrent_vector_base_v3::segment_t Class Reference

#include <concurrent_vector.h>

Collaboration diagram for tbb::internal::concurrent_vector_base_v3::segment_t:

Public Member Functions

 segment_t ()
 
 segment_t (segment_t const &rhs)
 
void swap (segment_t &rhs)
 
segment_toperator= (segment_t const &rhs)
 
template<memory_semantics M>
segment_value_t load () const
 
template<memory_semantics M>
void store (segment_not_used)
 
template<memory_semantics M>
void store (segment_allocation_failed)
 
template<memory_semantics M>
void store (void *allocated_segment_pointer) __TBB_NOEXCEPT(true)
 

Private Attributes

atomic< void * > array
 

Detailed Description

Definition at line 128 of file concurrent_vector.h.

Constructor & Destructor Documentation

◆ segment_t() [1/2]

tbb::internal::concurrent_vector_base_v3::segment_t::segment_t ( )
inline

Definition at line 131 of file concurrent_vector.h.

131 { store<relaxed>(segment_not_used());}

◆ segment_t() [2/2]

tbb::internal::concurrent_vector_base_v3::segment_t::segment_t ( segment_t const &  rhs)
inline

Definition at line 135 of file concurrent_vector.h.

135 { array.store<relaxed>(rhs.array.load<relaxed>());}
No ordering.
Definition: atomic.h:61

References array, and tbb::relaxed.

Member Function Documentation

◆ load()

template<memory_semantics M>
segment_value_t tbb::internal::concurrent_vector_base_v3::segment_t::load ( ) const
inline

◆ operator=()

segment_t& tbb::internal::concurrent_vector_base_v3::segment_t::operator= ( segment_t const &  rhs)
inline

Definition at line 141 of file concurrent_vector.h.

141  {
142  array.store<relaxed>(rhs.array.load<relaxed>());
143  return *this;
144  }
No ordering.
Definition: atomic.h:61

References array, and tbb::relaxed.

◆ store() [1/3]

template<memory_semantics M>
void tbb::internal::concurrent_vector_base_v3::segment_t::store ( segment_not_used  )
inline

Definition at line 150 of file concurrent_vector.h.

150  {
151  array.store<M>(0);
152  }

References array.

Referenced by tbb::internal::concurrent_vector_base_v3::internal_compact(), and tbb::concurrent_vector< padded_element, padded_allocator_type >::internal_free_segments().

Here is the caller graph for this function:

◆ store() [2/3]

template<memory_semantics M>
void tbb::internal::concurrent_vector_base_v3::segment_t::store ( segment_allocation_failed  )
inline

Definition at line 155 of file concurrent_vector.h.

155  {
156  __TBB_ASSERT(load<relaxed>() != segment_allocated(),"transition from \"allocated\" to \"allocation failed\" state looks non-logical");
158  }
static void *const vector_allocation_error_flag
Bad allocation marker.
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT, array, and tbb::internal::vector_allocation_error_flag.

◆ store() [3/3]

template<memory_semantics M>
void tbb::internal::concurrent_vector_base_v3::segment_t::store ( void allocated_segment_pointer)
inline

Definition at line 161 of file concurrent_vector.h.

161  {
162  __TBB_ASSERT(segment_value_t(allocated_segment_pointer) == segment_allocated(),
163  "other overloads of store should be used for marking segment as not_used or allocation_failed" );
164  array.store<M>(allocated_segment_pointer);
165  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT, and array.

◆ swap()

void tbb::internal::concurrent_vector_base_v3::segment_t::swap ( segment_t rhs)
inline

Definition at line 137 of file concurrent_vector.h.

137  {
138  tbb::internal::swap<relaxed>(array, rhs.array);
139  }

References array.

Member Data Documentation

◆ array

atomic<void*> tbb::internal::concurrent_vector_base_v3::segment_t::array
private

Definition at line 129 of file concurrent_vector.h.

Referenced by load(), operator=(), segment_t(), store(), and swap().


The documentation for this class was generated from the following file:

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.