Pyrogenesis
trunk
|
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.
typedef const T* AlignedAllocator< T >::const_pointer |
typedef const T& AlignedAllocator< T >::const_reference |
typedef std::ptrdiff_t AlignedAllocator< T >::difference_type |
typedef T* AlignedAllocator< T >::pointer |
typedef T& AlignedAllocator< T >::reference |
typedef std::size_t AlignedAllocator< T >::size_type |
typedef T AlignedAllocator< T >::value_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |