Class AlignedHeapAllocator¶
Defined in File aligned_heap_allocator.hpp
Class Documentation¶
-
class
ripple::AlignedHeapAllocator¶ This type implements an allocator which allocates aligned memory on the heap.
It’s the slowest allocator, and should therefore always be used as the last resort allocator.
Public Functions
-
AlignedHeapAllocator() = default¶ Default constructor.
-
~AlignedHeapAllocator() = default¶ Destructor defaulted.
-
template<typename
Arena>AlignedHeapAllocator(const Arena &arena)¶ Constructor which takes an Arena, which is provided for compatability with other allocators.
- Parameters
arena: The area to allocate memory from. Unused by this allocator.
- Template Parameters
Arena: The type of the arena.
-
AlignedHeapAllocator(AlignedHeapAllocator&&) = default¶ Move construcor defaulted.
-
auto
operator=(AlignedHeapAllocator&&) -> AlignedHeapAllocator& = default¶ Move assignment defaulted.
-
AlignedHeapAllocator(const AlignedHeapAllocator&) = delete¶ Copy constructor deleted since allocators can’t be moved.
-
auto
operator=(const AlignedHeapAllocator&) = delete¶ Copy assignment deleted since allocators can’t be copied.
-
auto
alloc(size_t size, size_t alignment) noexcept -> void*¶ Allocates size bytes of memory with align alignment.
- Parameters
size: The size of the memory to allocate.align: The alignment of the allocation.
-
auto
free(void *ptr) noexcept -> void¶ Frees the memory pointed to by ptr.
- Parameters
ptr: The pointer to the memory to free.
-
auto
free(void *ptr, size_t) noexcept -> void¶ Frees the memory pointed to by \ptr, with a size of
size.- Parameters
ptr: The pointer to the memory to free.
-