35 #ifndef _BLAZE_UTIL_MEMORY_H_
36 #define _BLAZE_UTIL_MEMORY_H_
83 template<
typename T >
89 if( alignment >= 8UL ) {
91 tmp = _aligned_malloc( size*
sizeof(T), alignment );
94 if( !posix_memalign( &tmp, alignment, size*
sizeof(T) ) )
96 return reinterpret_cast<T*
>( tmp );
97 else throw std::bad_alloc();
99 else return ::new T[size];
114 template<
typename T >
119 if( alignment >= 8UL ) {
120 #if defined(_MSC_VER)
121 _aligned_free( address );
126 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:115
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:84
Header file for basic type definitions.