35 #ifndef _BLAZE_UTIL_MEMORY_H_
36 #define _BLAZE_UTIL_MEMORY_H_
49 #include <boost/checked_delete.hpp>
84 template<
typename T >
93 tmp = _aligned_malloc( size*
sizeof(T), alignment );
96 if( !posix_memalign( &tmp, alignment, size*
sizeof(T) ) )
98 return reinterpret_cast<T*
>( tmp );
99 else throw std::bad_alloc();
101 else return new T[size];
112 template<
typename T >
116 #if defined(_MSC_VER)
117 _aligned_free( address );
123 boost::checked_array_delete( address );
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:107
void deallocate(T *address)
Deallocation of memory.
Definition: Memory.h:113
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.
T * allocate(size_t size)
Aligned array allocation.
Definition: Memory.h:85
Header file for the IsVectorizable type trait.
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
Header file for basic type definitions.