Struct HeapArena¶
Defined in File arena.hpp
Struct Documentation¶
-
struct
ripple
::
HeapArena
¶ Defines a heap-based arena for the host.
Public Functions
-
HeapArena
(size_t size = 0)¶ Initializes the arena with a specific size.
- Parameters
size
: The size of the arena.
-
~HeapArena
() noexcept¶ Destructor to release the memory.
-
ripple_nodiscard auto begin () const noexcept -> ConstPtr
Gets a pointer to the beginning of the arena.
- Return
A pointer to the beginning of the arena.
-
ripple_nodiscard auto end () const noexcept -> ConstPtr
Gets a pointer to the end of the arena.
- Return
A pointer to the end of the arena.
-
auto
resize
(size_t new_size) -> void¶ Resizes the area.
- Note
This may be expensive since it needs to copy the already allocated memory in the new space.
- Parameters
size
: The new size of the area.
-
ripple_nodiscard auto size () const noexcept -> size_t
Gets the size of the arena.
- Return
A size of the arena, in bytes.
-