35 #ifndef _BLAZE_UTIL_MEMORY_H_
36 #define _BLAZE_UTIL_MEMORY_H_
82 template<
typename T >
88 if( alignment >= 8UL ) {
90 tmp = _aligned_malloc( size*
sizeof(T), alignment );
93 if( !posix_memalign( &tmp, alignment, size*
sizeof(T) ) )
95 return reinterpret_cast<T*
>( tmp );
96 else throw std::bad_alloc();
98 else return ::new T[size];
113 template<
typename T >
118 if( alignment >= 8UL ) {
119 #if defined(_MSC_VER)
120 _aligned_free( address );
125 else delete[] address;
const blaze::Null NULL
Global NULL pointer.This instance of the Null class replaces the NULL macro to ensure a type-safe NUL...
Definition: Null.h:300
Header file for a safe C++ NULL pointer implementation.
void deallocate(T *address)
Deallocation of memory.
Definition: Memory.h:114
Header file for the alignment trait.
Evaluation of the required alignment of the given data type.The AlignmentTrait class template evaluat...
Definition: AlignmentTrait.h:79
T * allocate(size_t size)
Aligned array allocation.
Definition: Memory.h:83
Header file for basic type definitions.