146 if (!stack || !arena)
148 stack->
arena = arena;
199 if (!stack || !stack->
arena)
256 if (!stack || !stack->
arena || !stack->
top)
void * arena_alloc(t_arena *arena, size_t size)
void arena_pop(t_arena *arena, t_arena_marker marker)
t_arena_marker arena_mark(t_arena *arena)
Stack-based scope management for memory arenas.
size_t marker
Marker to rewind arena to this point.
t_arena_stack_frame * top
Top of the stack (most recent frame)
t_arena * arena
Arena associated with this stack.
struct s_arena_stack_frame * prev
Previous frame in the stack.
void arena_stack_push(t_arena_stack *stack)
Push the current arena state onto the stack.
void arena_stack_pop(t_arena_stack *stack)
Pop and restore the last saved state from the stack.
void arena_stack_init(t_arena_stack *stack, t_arena *arena)
Initialize an arena stack with a given arena.
void arena_stack_clear(t_arena_stack *stack)
Clear all stack frames without modifying arena state.
Stack structure for scoped arena memory control.
Internal frame representing a single state snapshot in the stack.
The main memory arena structure used for fast allocation.