35#ifndef _BLAZE_UTIL_ALIGNEDALLOCATOR_H_
36#define _BLAZE_UTIL_ALIGNEDALLOCATOR_H_
88 template<
typename U >
100 template<
typename U >
108 inline T*
allocate (
size_t numObjects );
109 inline void deallocate( T* ptr,
size_t numObjects )
noexcept;
129template<
typename T >
130template<
typename U >
158template<
typename T >
161 const size_t alignment( AlignmentOf_v<T> );
163 if( alignment >= 8UL ) {
164 return reinterpret_cast<T*
>(
alignedAllocate( numObjects*
sizeof(T), alignment ) );
167 return static_cast<T*
>(
operator new[]( numObjects *
sizeof( T ) ) );
184template<
typename T >
192 const size_t alignment( AlignmentOf_v<T> );
194 if( alignment >= 8UL ) {
198 operator delete[]( ptr );
215template<
typename T1,
typename T2 >
218template<
typename T1,
typename T2 >
Header file for the AlignmentOf type trait.
Header file for the MAYBE_UNUSED function template.
Header file for memory allocation and deallocation functionality.
Allocator for type-specific aligned memory.
Definition: AlignedAllocator.h:72
size_t SizeType
Size type of the aligned allocator.
Definition: AlignedAllocator.h:76
ValueType value_type
Type of the allocated values.
Definition: AlignedAllocator.h:80
T * allocate(size_t numObjects)
Allocates aligned memory for the specified number of objects.
Definition: AlignedAllocator.h:159
T ValueType
Type of the allocated values.
Definition: AlignedAllocator.h:75
void deallocate(T *ptr, size_t numObjects) noexcept
Deallocation of memory.
Definition: AlignedAllocator.h:185
ptrdiff_t DifferenceType
Difference type of the aligned allocator.
Definition: AlignedAllocator.h:77
SizeType size_type
Size type of the aligned allocator.
Definition: AlignedAllocator.h:81
DifferenceType difference_type
Difference type of the aligned allocator.
Definition: AlignedAllocator.h:82
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
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
void alignedDeallocate(const void *address) noexcept
Deallocation of aligned memory.
Definition: Memory.h:115
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
byte_t * alignedAllocate(size_t size, size_t alignment)
Aligned array allocation.
Definition: Memory.h:82
Implementation of the AlignedAllocator rebind mechanism.
Definition: AlignedAllocator.h:90
Header file for basic type definitions.