Allocators

The Allocators offer allocators - C++ structures for memory allocation. A general introduction into the subject of memory allocation might be useful. When looking for an allocator, you should probably first consider the allocators in the GNU libstdc++.

AlignAllocator

The AlignAllocator allocates memory that is aligned on a chosen boundary. The alignment is by default chosen on an address divisable by 4 * N * sizeof(T), where N is a specified number of elements. This alignment allows SIMD instruction such as MMX, SSE and SSE2 to be used on the data, thus providing significant speedup over non-aligned data. The allocation is done using the posix_memalign system call. The formal definition is:
template<typename _Tp, unsigned N = 4u>
class AlignAllocator;