35 #ifndef _BLAZE_UTIL_ALIGNEDALLOCATOR_H_ 36 #define _BLAZE_UTIL_ALIGNEDALLOCATOR_H_ 68 template<
typename Type >
94 template<
typename Type2 >
106 template<
typename Type2 >
114 inline constexpr
size_t max_size() const noexcept;
123 inline
Pointer allocate (
size_t numObjects, const
void* localityHint =
nullptr );
131 template< typename... Args >
152 template< typename Type >
163 template<
typename Type >
164 template<
typename Type2 >
185 template<
typename Type >
188 return size_t(-1) /
sizeof( Type );
198 template<
typename Type >
212 template<
typename Type >
242 template<
typename Type >
248 const size_t alignment( AlignmentOf_v<Type> );
250 if( alignment >= 8UL ) {
251 return reinterpret_cast<Type*
>( allocate_backend( numObjects*
sizeof(Type), alignment ) );
254 return static_cast<Pointer>(
operator new[]( numObjects *
sizeof( Type ) ) );
271 template<
typename Type >
279 const size_t alignment( AlignmentOf_v<Type> );
281 if( alignment >= 8UL ) {
282 deallocate_backend( ptr );
285 operator delete[]( ptr );
309 template<
typename Type >
310 template<
typename... Args >
313 ::new( ptr ) Type( std::forward<Args>( args )... );
327 template<
typename Type >
346 template<
typename T1,
typename T2 >
349 template<
typename T1,
typename T2 >
362 template<
typename T1
379 template<
typename T1
constexpr size_t max_size() const noexcept
Returns the maximum possible number of elements that can be allocated together.
Definition: AlignedAllocator.h:186
Header file for the AlignmentOf type trait.
Header file for the UNUSED_PARAMETER function template.
ValueType value_type
Type of the allocated values.
Definition: AlignedAllocator.h:82
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
Header file for memory allocation and deallocation functionality.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
void destroy(Pointer ptr) noexcept
Destroys the object of type Type at the specified memory location.
Definition: AlignedAllocator.h:328
Pointer address(Reference x) const noexcept
Returns the address of the given element.
Definition: AlignedAllocator.h:200
DifferenceType difference_type
Difference type of the aligned allocator.
Definition: AlignedAllocator.h:88
ConstPointer const_pointer
Type of a pointer-to-const to the allocated values.
Definition: AlignedAllocator.h:84
Pointer pointer
Type of a pointer to the allocated values.
Definition: AlignedAllocator.h:83
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Pointer allocate(size_t numObjects, const void *localityHint=nullptr)
Allocates aligned memory for the specified number of objects.
Definition: AlignedAllocator.h:244
SizeType size_type
Size type of the aligned allocator.
Definition: AlignedAllocator.h:87
Type * Pointer
Type of a pointer to the allocated values.
Definition: AlignedAllocator.h:74
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:253
void construct(Pointer ptr, Args &&... args)
Constructs an object of type Type at the specified memory location.
Definition: AlignedAllocator.h:311
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Allocator for type-specific aligned memory.The AlignedAllocator class template represents an implemen...
Definition: AlignedAllocator.h:69
void deallocate(Pointer ptr, size_t numObjects) noexcept
Deallocation of memory.
Definition: AlignedAllocator.h:272
const Type * ConstPointer
Type of a pointer-to-const to the allocated values.
Definition: AlignedAllocator.h:75
Type ValueType
Type of the allocated values.
Definition: AlignedAllocator.h:73
AlignedAllocator()
The default constructor for AlignedAllocator.
Definition: AlignedAllocator.h:153
Reference reference
Type of a reference to the allocated values.
Definition: AlignedAllocator.h:85
Type & Reference
Type of a reference to the allocated values.
Definition: AlignedAllocator.h:76
std::ptrdiff_t DifferenceType
Difference type of the aligned allocator.
Definition: AlignedAllocator.h:79
std::size_t SizeType
Size type of the aligned allocator.
Definition: AlignedAllocator.h:78
const Type & ConstReference
Type of a reference-to-const to the allocated values.
Definition: AlignedAllocator.h:77
ConstReference const_reference
Type of a reference-to-const to the allocated values.
Definition: AlignedAllocator.h:86
Size type of the Blaze library.
Implementation of the AlignedAllocator rebind mechanism.
Definition: AlignedAllocator.h:95