intnslib 0.1
A library to hold common functionality used across multiple projects.
Loading...
Searching...
No Matches
intns::memory::StackCheckpoint Class Reference

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
 
StackCheckpointoperator= (const StackCheckpoint &)=delete
 
 StackCheckpoint (StackCheckpoint &&)=delete
 
StackCheckpointoperator= (StackCheckpoint &&)=delete
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ StackCheckpoint()

intns::memory::StackCheckpoint::StackCheckpoint ( StackAllocator a)
inline

Constructor that saves current state of the given StackAllocator.

Parameters
aReference to the StackAllocator whose state will be checkpointed.

◆ ~StackCheckpoint()

intns::memory::StackCheckpoint::~StackCheckpoint ( )
inline

Destructor for the StackCheckpoint class.

Restores the allocator to the saved checkpoint upon destruction, releasing post-checkpoint allocations and maintaining stack-like semantics.


The documentation for this class was generated from the following file: