Struct HeapArena

Struct Documentation

struct wrench::HeapArena

Defines a heap-based arena.

Public Types

using Ptr = void*

Pointer type.

using ConstPtr = void*

Const pointer type.

Public Functions

HeapArena(size_t size)

Initializes the arena with a specific size.

Parameters
  • size: The size of the arena, in bytes.

~HeapArena() noexcept

Destructor to release the memory.

HeapArena(const HeapArena&) = delete

Copy constructor deleted.

HeapArena(HeapArena&&) noexcept = delete

Move constructor deleted.

auto operator= (const HeapArena &) -> HeapArena &=delete

Copy assignment operator deleted.

auto operator= (HeapArena &&) noexcept -> HeapArena &=delete

Move assignment operator deleted.

wrench_no_discard auto begin () const noexcept -> ConstPtr

Returns a pointer to the beginning of the arena.

wrench_no_discard auto end () const noexcept -> ConstPtr

Returns a pointer to the end of the arena.

wrench_no_discard auto size () const noexcept -> size_t

Returns the size of the arena.

Public Static Attributes

constexpr bool constexpr_size = false

Returns that the allocator does not have a constexpr size.