23#ifndef CONTAINER_ARRAY_ATOMICS_INDEX_PADDING
24#define CONTAINER_ARRAY_ATOMICS_INDEX_PADDING
58 using type = std::atomic<T>;
111 return index * this->m_cacheline_size;
116 return memory::minimum_cacheline_for<Padded_indexing::type>();
Indexing provider that pads each of the array elements to the size of the CPU cache line,...
Definition: atomics_array_index_padding.h:56
size_t translate(size_t index) const
Translates the element index to the byte position in the array.
Definition: atomics_array_index_padding.h:110
Padded_indexing(size_t max_size)
Constructor for the class that takes the maximum allowed number of elements in the array.
Definition: atomics_array_index_padding.h:99
size_t size() const
The size of the array.
Definition: atomics_array_index_padding.h:105
size_t m_size
The size of the array.
Definition: atomics_array_index_padding.h:92
std::atomic< T > type
Definition: atomics_array_index_padding.h:58
static size_t element_size()
The array element size, in bytes.
Definition: atomics_array_index_padding.h:115
virtual ~Padded_indexing()=default
Class destructor.
size_t m_cacheline_size
The size of the CPU cache line.
Definition: atomics_array_index_padding.h:94
Definition: atomics_array.h:38
Definition: aligned_atomic.h:43
static size_t minimum_cacheline_for()
Retrieves the amount of bytes, multiple of the current cacheline size, needed to store an element of ...
Definition: aligned_atomic.h:132