Pyrogenesis
13997
|
stateless STL allocator that aligns elements to the L1 cache line size. More...
#include <aligned_allocator.h>
Classes | |
struct | rebind |
Public Types | |
typedef T | value_type |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T & | reference |
typedef const T & | const_reference |
typedef std::size_t | size_type |
typedef std::ptrdiff_t | difference_type |
Public Member Functions | |
pointer | address (reference value) const |
const_pointer | address (const_reference value) const |
NOTHROW_DEFINE | AlignedAllocator () |
NOTHROW_DEFINE | AlignedAllocator (const AlignedAllocator &) |
template<class U > | |
NOTHROW_DEFINE | AlignedAllocator (const AlignedAllocator< U > &) |
NOTHROW_DEFINE | ~AlignedAllocator () |
NOTHROW_DEFINE size_type | max_size () const |
pointer | allocate (size_type numElements) |
void | deallocate (pointer p, size_type num) |
void | construct (pointer p, const T &value) |
void | destroy (pointer p) |
stateless STL allocator that aligns elements to the L1 cache line size.
note: the alignment is hard-coded to avoid any allocator state. this avoids portability problems, which is important since allocators are rather poorly specified.
references: http://www.tantalon.com/pete/customallocators.ppt http://www.flipcode.com/archives/Aligned_Block_Allocation.shtml http://www.josuttis.com/cppcode/allocator.html
derived from code that bears the following copyright notice: (C) Copyright Nicolai M. Josuttis 1999. Permission to copy, use, modify, sell and distribute this software is granted provided this copyright notice appears in all copies. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.
Definition at line 55 of file aligned_allocator.h.
typedef const T* AlignedAllocator< T >::const_pointer |
Definition at line 61 of file aligned_allocator.h.
typedef const T& AlignedAllocator< T >::const_reference |
Definition at line 63 of file aligned_allocator.h.
typedef std::ptrdiff_t AlignedAllocator< T >::difference_type |
Definition at line 65 of file aligned_allocator.h.
typedef T* AlignedAllocator< T >::pointer |
Definition at line 60 of file aligned_allocator.h.
typedef T& AlignedAllocator< T >::reference |
Definition at line 62 of file aligned_allocator.h.
typedef std::size_t AlignedAllocator< T >::size_type |
Definition at line 64 of file aligned_allocator.h.
typedef T AlignedAllocator< T >::value_type |
Definition at line 59 of file aligned_allocator.h.
|
inline |
Definition at line 84 of file aligned_allocator.h.
|
inline |
Definition at line 88 of file aligned_allocator.h.
|
inline |
Definition at line 93 of file aligned_allocator.h.
|
inline |
Definition at line 97 of file aligned_allocator.h.
|
inline |
Definition at line 74 of file aligned_allocator.h.
|
inline |
Definition at line 79 of file aligned_allocator.h.
|
inline |
Definition at line 108 of file aligned_allocator.h.
|
inline |
Definition at line 123 of file aligned_allocator.h.
|
inline |
Definition at line 118 of file aligned_allocator.h.
|
inline |
Definition at line 128 of file aligned_allocator.h.
|
inline |
Definition at line 101 of file aligned_allocator.h.