|
memory_arena
|
Stack-based scope management for memory arenas. More...
Include dependency graph for arena_stack.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | s_arena_stack |
| Stack structure for scoped arena memory control. More... | |
| struct | s_arena_stack_frame |
| Internal frame representing a single state snapshot in the stack. More... | |
Typedefs | |
| typedef struct s_arena_stack | t_arena_stack |
| Stack structure for scoped arena memory control. | |
| typedef struct s_arena_stack_frame | t_arena_stack_frame |
| Internal frame representing a single state snapshot in the stack. | |
Functions | |
| void | arena_stack_clear (t_arena_stack *stack) |
| Clear all stack frames without modifying arena state. | |
| void | arena_stack_init (t_arena_stack *stack, t_arena *arena) |
| Initialize an arena stack with a given arena. | |
| void | arena_stack_pop (t_arena_stack *stack) |
| Pop and restore the last saved state from the stack. | |
| void | arena_stack_push (t_arena_stack *stack) |
| Push the current arena state onto the stack. | |
Stack-based scope management for memory arenas.
This module defines a lightweight stack structure to manage allocation scopes within a memory arena. It enables nested usage patterns similar to function call stacks, where each push operation records a restore point, and each pop rewinds the arena back to that state using arena_pop().
Features:
arena_mark() and arena_pop()Typical use case:
Definition in file arena_stack.h.