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_t & | operator= (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.

{ 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.

{ array.store<relaxed>(rhs.array.load<relaxed>());}
tbb::relaxed
@ relaxed
No ordering.
Definition: atomic.h:61
tbb::internal::concurrent_vector_base_v3::segment_t::array
atomic< void * > array
Definition: concurrent_vector.h:129

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

Definition at line 147 of file concurrent_vector.h.

{ return segment_value_t(array.load<M>());}

References array.

Referenced by tbb::internal::concurrent_vector_base_v3::helper::cleanup(), tbb::internal::concurrent_vector_base_v3::helper::extend_segment_table(), tbb::internal::concurrent_vector_base_v3::internal_compact(), tbb::concurrent_vector< T, A >::internal_free_segments(), and tbb::internal::concurrent_vector_base_v3::helper::segment_not_used_predicate::operator()().

Here is the caller graph for this function:

## 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.

{
array.store<relaxed>(rhs.array.load<relaxed>());
return *this;
}

References array, and tbb::relaxed.

## store() [1/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.

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

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

## store() [2/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.

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

References array.

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

Here is the caller graph for this function:

## 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.

{
__TBB_ASSERT(segment_value_t(allocated_segment_pointer) == segment_allocated(),
"other overloads of store should be used for marking segment as not_used or allocation_failed" );
array.store<M>(allocated_segment_pointer);
}

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.

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

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:

- concurrent_vector.h

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.