intnslib 0.1
A library to hold common functionality used across multiple projects.
|
RAII wrapper for StackAllocator to manage scoped memory checkpoints. More...
#include <StackAllocator.hpp>
Public Member Functions | |
StackCheckpoint (StackAllocator &a) | |
Constructor that saves current state of the given StackAllocator. | |
~StackCheckpoint () | |
Destructor for the StackCheckpoint class. | |
StackCheckpoint (const StackCheckpoint &)=delete | |
StackCheckpoint & | operator= (const StackCheckpoint &)=delete |
StackCheckpoint (StackCheckpoint &&)=delete | |
StackCheckpoint & | operator= (StackCheckpoint &&)=delete |
RAII wrapper for StackAllocator to manage scoped memory checkpoints.
StackCheckpoint captures the StackAllocator state on creation and restores it on destruction, ensuring all subsequent allocations are released when it goes out of scope.
Copying and moving are disabled to strictly enforce scope management.
|
inline |
Constructor that saves current state of the given StackAllocator.
a | Reference to the StackAllocator whose state will be checkpointed. |
|
inline |
Destructor for the StackCheckpoint class.
Restores the allocator to the saved checkpoint upon destruction, releasing post-checkpoint allocations and maintaining stack-like semantics.