Allocates a block of memory on the specified alignment. The actual size of the allocated memory is larger than the requested size by the alignment, so allocating 1 byte on 64 byte alignment will allocate 65 bytes. More...
#include <aligned_buffer.hpp>
Public Member Functions | |
AlignedBuffer (size_t byte_size, size_t alignment=64) | |
AlignedBuffer (AlignedBuffer &&other) | |
AlignedBuffer & | operator= (AlignedBuffer &&other) |
size_t | size () const |
void * | get_ptr (size_t offset) const |
void * | get_ptr () |
const void * | get_ptr () const |
template<typename T > | |
T * | get_ptr () |
template<typename T > | |
const T * | get_ptr () const |
template<typename T > | |
operator T* () | |
Protected Attributes | |
char * | m_allocated_buffer |
char * | m_aligned_buffer |
size_t | m_byte_size |
Allocates a block of memory on the specified alignment. The actual size of the allocated memory is larger than the requested size by the alignment, so allocating 1 byte on 64 byte alignment will allocate 65 bytes.