STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Classes | Public Member Functions | Public Types
stapl::runtime::cache_line_aligned_allocator< T > Class Template Reference

An allocator that enforces that all allocated memory returned to the caller begins at the start of a cache line. More...

Classes

struct  rebind
 Provides a way to obtain an allocator for a different type. More...
 

Public Member Functions

 cache_line_aligned_allocator (cache_line_aligned_allocator const &) noexcept=default
 
template<typename U >
 cache_line_aligned_allocator (cache_line_aligned_allocator< U > const &) noexcept
 
pointer address (reference x) const noexcept
 
const_pointer address (const_reference x) const noexcept
 
pointer allocate (size_type n, cache_line_aligned_allocator< void >::const_pointer=0)
 
void deallocate (pointer p, size_type)
 
size_type max_size (void) const noexcept
 
void construct (pointer p, const_reference val)
 
void destroy (pointer p)
 
template<typename U , typename... Args>
void construct (U *p, Args &&... args)
 
template<typename U >
void destroy (U *p)
 

Public Types

using size_type = std::size_t
 
using difference_type = std::ptrdiff_t
 
using pointer = T *
 
using const_pointer = const T *
 
using reference = T &
 
using const_reference = T const &
 
using value_type = T
 

Detailed Description

template<typename T>
class stapl::runtime::cache_line_aligned_allocator< T >

An allocator that enforces that all allocated memory returned to the caller begins at the start of a cache line.

Backed by malloc, this allocator overallocates enough to be able to (a) advance pointer to proper alignment and (b) have storage in front for original address malloc() gave to it (so that it can properly call free().


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