walberla::simd::aligned_allocator< T, Alignment > Struct Template Reference

Detailed Description

template<class T, size_t Alignment>
struct walberla::simd::aligned_allocator< T, Alignment >

STL-compliant allocator that allocates aligned memory.

Template Parameters
TType of the element to allocate.
AlignmentAlignment of the allocation, e.g. 16.

#include <AlignedAllocator.h>

+ Inheritance diagram for walberla::simd::aligned_allocator< T, Alignment >:

Classes

struct  rebind
 Defines an aligned allocator suitable for allocating elements of type U. More...
 

Public Types

typedef std::allocator< T >::size_type size_type
 
typedef std::allocator< T >::pointer pointer
 
typedef std::allocator< T >::const_pointer const_pointer
 

Public Member Functions

 aligned_allocator () throw ()
 Default-constructs an allocator. More...
 
 aligned_allocator (const aligned_allocator &other) throw ()
 Copy-constructs an allocator. More...
 
template<class U >
 aligned_allocator (const aligned_allocator< U, Alignment > &) throw ()
 Convert-constructs an allocator. More...
 
 ~aligned_allocator () throw ()
 Destroys an allocator. More...
 
pointer allocate (size_type n)
 Allocates n elements of type T, aligned to a multiple of Alignment. More...
 
pointer allocate (size_type n, const_pointer)
 Allocates n elements of type T, aligned to a multiple of Alignment. More...
 
void deallocate (pointer p, size_type)
 Frees the memory previously allocated by an aligned allocator. More...
 

Member Typedef Documentation

◆ const_pointer

template<class T , size_t Alignment>
typedef std::allocator<T>::const_pointer walberla::simd::aligned_allocator< T, Alignment >::const_pointer

◆ pointer

template<class T , size_t Alignment>
typedef std::allocator<T>::pointer walberla::simd::aligned_allocator< T, Alignment >::pointer

◆ size_type

template<class T , size_t Alignment>
typedef std::allocator<T>::size_type walberla::simd::aligned_allocator< T, Alignment >::size_type

Constructor & Destructor Documentation

◆ aligned_allocator() [1/3]

template<class T , size_t Alignment>
walberla::simd::aligned_allocator< T, Alignment >::aligned_allocator ( )
throw (
)
inline

Default-constructs an allocator.

◆ aligned_allocator() [2/3]

template<class T , size_t Alignment>
walberla::simd::aligned_allocator< T, Alignment >::aligned_allocator ( const aligned_allocator< T, Alignment > &  other)
throw (
)
inline

Copy-constructs an allocator.

◆ aligned_allocator() [3/3]

template<class T , size_t Alignment>
template<class U >
walberla::simd::aligned_allocator< T, Alignment >::aligned_allocator ( const aligned_allocator< U, Alignment > &  )
throw (
)
inline

Convert-constructs an allocator.

◆ ~aligned_allocator()

template<class T , size_t Alignment>
walberla::simd::aligned_allocator< T, Alignment >::~aligned_allocator ( )
throw (
)
inline

Destroys an allocator.

Member Function Documentation

◆ allocate() [1/2]

template<class T , size_t Alignment>
pointer walberla::simd::aligned_allocator< T, Alignment >::allocate ( size_type  n)
inline

Allocates n elements of type T, aligned to a multiple of Alignment.

◆ allocate() [2/2]

template<class T , size_t Alignment>
pointer walberla::simd::aligned_allocator< T, Alignment >::allocate ( size_type  n,
const_pointer   
)
inline

Allocates n elements of type T, aligned to a multiple of Alignment.

◆ deallocate()

template<class T , size_t Alignment>
void walberla::simd::aligned_allocator< T, Alignment >::deallocate ( pointer  p,
size_type   
)
inline

Frees the memory previously allocated by an aligned allocator.


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