|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Arena-backed ownership context for CFG objects. More...
#include <Compiler_CFG.H>
Classes | |
| struct | Owned_Object |
| Internal tracker for objects with non-trivial destructors. More... | |
Public Member Functions | |
| Compiler_CFG_Context (const size_t arena_size=AhArenaAllocator::DEFAULT_SIZE) | |
| Constructs a CFG context. | |
| Compiler_CFG_Context (const Compiler_CFG_Context &)=delete | |
| Compiler_CFG_Context & | operator= (const Compiler_CFG_Context &)=delete |
| ~Compiler_CFG_Context () noexcept | |
| Cleans up the context and all managed objects. | |
| template<typename T , typename... Args> | |
| T * | make (Args &&...args) |
| Allocates and constructs an object in the arena. | |
| void | reset () noexcept |
| Resets the arena and destroys all tracked objects. | |
| size_t | allocated_size () const noexcept |
| Returns currently used bytes. | |
Private Attributes | |
| AhArenaAllocator | arena_ |
| DynArray< Owned_Object > | owned_ |
Arena-backed ownership context for CFG objects.
Ensures efficient allocation and bulk destruction of CFG-related data.
Definition at line 190 of file Compiler_CFG.H.
|
inlineexplicit |
Constructs a CFG context.
Definition at line 204 of file Compiler_CFG.H.
|
delete |
|
inlinenoexcept |
Cleans up the context and all managed objects.
Definition at line 212 of file Compiler_CFG.H.
References reset().
|
inlinenoexcept |
Returns currently used bytes.
Definition at line 246 of file Compiler_CFG.H.
References Aleph::AhArenaAllocator::allocated_size(), and arena_.
Allocates and constructs an object in the arena.
Definition at line 219 of file Compiler_CFG.H.
References ah_runtime_error_unless, arena_, Aleph::blossom_maximum_cardinality_matching(), and owned_.
Referenced by Aleph::Compiler_CFG_Lowering::lower_module(), and Aleph::Compiler_CFG_Lowering::lower_statement_sequence().
|
delete |
|
inlinenoexcept |
Resets the arena and destroys all tracked objects.
Definition at line 233 of file Compiler_CFG.H.
References Aleph::and, arena_, owned_, and Aleph::AhArenaAllocator::reset().
Referenced by ~Compiler_CFG_Context().
|
private |
Definition at line 199 of file Compiler_CFG.H.
Referenced by allocated_size(), make(), and reset().
|
private |
Definition at line 200 of file Compiler_CFG.H.