35 #ifndef _BLAZE_UTIL_ALIGNEDALLOCATOR_H_
36 #define _BLAZE_UTIL_ALIGNEDALLOCATOR_H_
69 template<
typename Type >
95 template<
typename Type2 >
107 template<
typename Type2 >
116 inline Pointer
address( Reference x )
const;
117 inline ConstPointer
address( ConstReference x )
const;
124 inline Pointer
allocate (
size_t numObjects,
const void* localityHint = NULL );
125 inline void deallocate( Pointer ptr,
size_t numObjects );
132 inline void construct( Pointer ptr,
const Type& value );
133 inline void destroy ( Pointer ptr );
151 template<
typename Type >
162 template<
typename Type >
163 template<
typename Type2 >
184 template<
typename Type >
187 return size_t(-1) /
sizeof( Type );
197 template<
typename Type >
211 template<
typename Type >
241 template<
typename Type >
242 inline typename AlignedAllocator<Type>::Pointer
249 if( alignment >= 8UL ) {
250 return reinterpret_cast<Type*
>( allocate_backend( numObjects*
sizeof(Type), alignment ) );
253 return static_cast<Pointer>(
operator new[]( numObjects *
sizeof( Type ) ) );
270 template<
typename Type >
280 if( alignment >= 8UL ) {
281 deallocate_backend( ptr );
284 operator delete[]( ptr );
308 template<
typename Type >
311 ::new( ptr ) Type( value );
325 template<
typename Type >
344 template<
typename T1,
typename T2 >
347 template<
typename T1,
typename T2 >
360 template<
typename T1
377 template<
typename T1
Type ValueType
Type of the allocated values.
Definition: AlignedAllocator.h:74
SizeType size_type
Size type of the aligned allocator.
Definition: AlignedAllocator.h:88
Header file for the AlignmentOf type trait.
Header file for the UNUSED_PARAMETER function template.
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Type * Pointer
Type of a pointer to the allocated values.
Definition: AlignedAllocator.h:75
AlignedAllocator< Type2 > other
Type of the other allocator.
Definition: AlignedAllocator.h:98
Header file for memory allocation and deallocation functionality.
const Type & ConstReference
Type of a reference-to-const to the allocated values.
Definition: AlignedAllocator.h:78
std::ptrdiff_t DifferenceType
Difference type of the aligned allocator.
Definition: AlignedAllocator.h:80
const Type * ConstPointer
Type of a pointer-to-const to the allocated values.
Definition: AlignedAllocator.h:76
Pointer allocate(size_t numObjects, const void *localityHint=NULL)
Allocates aligned memory for the specified number of objects.
Definition: AlignedAllocator.h:243
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
size_t max_size() const
Returns the maximum possible number of elements that can be allocated together.
Definition: AlignedAllocator.h:185
ValueType value_type
Type of the allocated values.
Definition: AlignedAllocator.h:83
void construct(Pointer ptr, const Type &value)
Constructs an object of type Type at the specified memory location.
Definition: AlignedAllocator.h:309
DifferenceType difference_type
Difference type of the aligned allocator.
Definition: AlignedAllocator.h:89
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2590
Allocator for type-specific aligned memory.The AlignedAllocator class template represents an implemen...
Definition: AlignedAllocator.h:70
ConstReference const_reference
Type of a reference-to-const to the allocated values.
Definition: AlignedAllocator.h:87
std::size_t SizeType
Size type of the aligned allocator.
Definition: AlignedAllocator.h:79
Pointer pointer
Type of a pointer to the allocated values.
Definition: AlignedAllocator.h:84
void deallocate(Pointer ptr, size_t numObjects)
Deallocation of memory.
Definition: AlignedAllocator.h:271
ConstPointer const_pointer
Type of a pointer-to-const to the allocated values.
Definition: AlignedAllocator.h:85
Pointer address(Reference x) const
Returns the address of the given element.
Definition: AlignedAllocator.h:199
AlignedAllocator()
The default constructor for AlignedAllocator.
Definition: AlignedAllocator.h:152
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Reference reference
Type of a reference to the allocated values.
Definition: AlignedAllocator.h:86
void destroy(Pointer ptr)
Destroys the object of type Type at the specified memory location.
Definition: AlignedAllocator.h:326
Size type of the Blaze library.
Evaluation of the required alignment of the given data type.The AlignmentOf type trait template evalu...
Definition: AlignmentOf.h:77
Type & Reference
Type of a reference to the allocated values.
Definition: AlignedAllocator.h:77
Implementation of the AlignedAllocator rebind mechanism.
Definition: AlignedAllocator.h:96
Header file for a safe C++ NULL pointer implementation.