27 #ifndef ALIGNED_ALLOCATOR 28 #define ALIGNED_ALLOCATOR 79 const_pointer
address(const_reference value)
const 104 return std::numeric_limits<std::size_t>::max() /
sizeof(
T);
111 const size_type elementSize =
round_up(
sizeof(
T), alignment);
112 const size_type size = numElements * elementSize;
125 new((
void*)p)
T(value);
136 template <
class T1,
class T2>
142 template <
class T1,
class T2>
148 #endif // #ifndef ALIGNED_ALLOCATOR void * rtl_AllocateAligned(size_t size, size_t align)
Definition: gcc.cpp:66
NOTHROW_DEFINE AlignedAllocator(const AlignedAllocator &)
Definition: aligned_allocator.h:88
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
Definition: code_annotation.h:38
T value_type
Definition: aligned_allocator.h:59
NOTHROW_DEFINE ~AlignedAllocator()
Definition: aligned_allocator.h:97
Definition: aligned_allocator.h:69
const x86_x64::Cache * Caches(size_t idxCache)
Definition: cache.cpp:649
std::size_t size_type
Definition: aligned_allocator.h:64
void construct(pointer p, const T &value)
Definition: aligned_allocator.h:123
T round_up(T n, T multiple)
round number up/down to the next given multiple.
Definition: bits.h:265
#define NOTHROW_DEFINE
Definition: code_annotation.h:86
const T & const_reference
Definition: aligned_allocator.h:63
AlignedAllocator< U > other
Definition: aligned_allocator.h:71
#define UNUSED2(param)
mark a function local variable or parameter as unused and avoid the corresponding compiler warning...
Definition: code_annotation.h:56
NOTHROW_DEFINE AlignedAllocator(const AlignedAllocator< U > &)
Definition: aligned_allocator.h:93
pointer address(reference value) const
Definition: aligned_allocator.h:74
NOTHROW_DEFINE AlignedAllocator()
Definition: aligned_allocator.h:84
void destroy(pointer p)
Definition: aligned_allocator.h:128
const T * const_pointer
Definition: aligned_allocator.h:61
#define T(string_literal)
Definition: secure_crt.cpp:76
T * pointer
Definition: aligned_allocator.h:60
NOTHROW_DEFINE size_type max_size() const
Definition: aligned_allocator.h:101
stateless STL allocator that aligns elements to the L1 cache line size.
Definition: aligned_allocator.h:55
T & reference
Definition: aligned_allocator.h:62
const_pointer address(const_reference value) const
Definition: aligned_allocator.h:79
NOTHROW_DEFINE bool operator!=(const AlignedAllocator< T1 > &, const AlignedAllocator< T2 > &)
Definition: aligned_allocator.h:143
pointer allocate(size_type numElements)
Definition: aligned_allocator.h:108
void rtl_FreeAligned(void *alignedPointer)
Definition: gcc.cpp:93
void deallocate(pointer p, size_type num)
Definition: aligned_allocator.h:118
size_t entrySize
NB: cache entries are lines, TLB entries are pages.
Definition: cache.h:62
NOTHROW_DEFINE bool operator==(const AlignedAllocator< T1 > &, const AlignedAllocator< T2 > &)
Definition: aligned_allocator.h:137
std::ptrdiff_t difference_type
Definition: aligned_allocator.h:65