DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
ScratchScope Class Reference

RAII scope guard for transient scratch borrows. More...

#include <scratch.h>

Public Member Functions

 ScratchScope ()
 
 ~ScratchScope ()
 
 ScratchScope (const ScratchScope &)=delete
 
ScratchScopeoperator= (const ScratchScope &)=delete
 

Detailed Description

RAII scope guard for transient scratch borrows.

Marks the arena on construction and restores it on destruction, so every scratch_alloc() made within the scope is reclaimed on every exit path (return, break, fall-through) - the safe way to borrow transient scratch in a function with multiple returns. Scopes must nest (LIFO); the per-dispatch scratch_reset() is the backstop if one is ever skipped.

Definition at line 109 of file scratch.h.

Constructor & Destructor Documentation

◆ ScratchScope() [1/2]

ScratchScope::ScratchScope ( )
inline

Definition at line 112 of file scratch.h.

◆ ~ScratchScope()

ScratchScope::~ScratchScope ( )
inline

Definition at line 115 of file scratch.h.

References scratch_release().

◆ ScratchScope() [2/2]

ScratchScope::ScratchScope ( const ScratchScope )
delete

Member Function Documentation

◆ operator=()

ScratchScope & ScratchScope::operator= ( const ScratchScope )
delete

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