MathFu
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Friends Groups Pages
mathfu::simd_allocator< T > Class Template Reference

SIMD-safe memory allocator, for use with STL types like std::vector. More...

#include <utilities.h>

Inherits allocator< T >.

Detailed Description

template<typename T>
class mathfu::simd_allocator< T >

SIMD-safe memory allocator, for use with STL types like std::vector.

For example:

std::vector<vec4, mathfu::simd_allocator<vec4>> myvector;

See Also
MATHFU_DEFINE_GLOBAL_SIMD_AWARE_NEW_DELETE
Template Parameters
Ttype allocated by this object.

Classes

struct  rebind
 Obtains an allocator of a different type. More...
 

Public Types

typedef size_t size_type
 Size type.
 
typedef T * pointer
 Pointer of type T.
 
typedef const T * const_pointer
 Const pointer of type T.
 

Public Member Functions

 simd_allocator () throw ()
 Constructs a simd_allocator.
 
 simd_allocator (const simd_allocator &a) throw ()
 Constructs and copies a simd_allocator. More...
 
template<class U >
 simd_allocator (const simd_allocator< U > &a) throw ()
 Constructs and copies a simd_allocator. More...
 
 ~simd_allocator () throw ()
 Destructs a simd_allocator.
 
pointer allocate (size_type n)
 Allocate memory for object T. More...
 
void deallocate (pointer p, size_type)
 

Constructor & Destructor Documentation

template<typename T>
mathfu::simd_allocator< T >::simd_allocator ( const simd_allocator< T > &  a)
throw (
)
inline

Constructs and copies a simd_allocator.

Parameters
aAllocator to copy.
template<typename T>
template<class U >
mathfu::simd_allocator< T >::simd_allocator ( const simd_allocator< U > &  a)
throw (
)
inline

Constructs and copies a simd_allocator.

Parameters
aAllocator to copy.
Template Parameters
Utype of the object allocated by the allocator to copy.

Member Function Documentation

template<typename T>
pointer mathfu::simd_allocator< T >::allocate ( size_type  n)
inline

Allocate memory for object T.

Parameters
nNumber of types to allocate.
Returns
Pointer to the newly allocated memory.
template<typename T>
void mathfu::simd_allocator< T >::deallocate ( pointer  p,
size_type   
)
inline

Deallocate memory referenced by pointer p.

Parameters
pPointer to memory to deallocate.

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