|
memory_arena
|
Arena state inspection and control utilities. More...
#include "arena.h"
Include dependency graph for arena_state.c:Go to the source code of this file.
Functions | |
| t_arena_marker | arena_mark (t_arena *arena) |
| size_t | arena_peak (t_arena *arena) |
| void | arena_pop (t_arena *arena, t_arena_marker marker) |
| size_t | arena_remaining (t_arena *arena) |
| void | arena_reset (t_arena *arena) |
| size_t | arena_used (t_arena *arena) |
Arena state inspection and control utilities.
This module provides utility functions for inspecting and manipulating the state of a memory arena without modifying its underlying buffer directly. These functions support read-only queries (e.g., used, remaining, peak usage), as well as efficient bulk memory rollback via markers (arena_mark() and arena_pop()) and full arena reset.
Features:
arena_used, arena_remaining, arena_peak).arena_mark() and arena_pop().arena_reset().These utilities are thread-safe and lock the arena internally before accessing or modifying its state.
Definition in file arena_state.c.
| t_arena_marker arena_mark | ( | t_arena * | arena | ) |
Definition at line 227 of file arena_state.c.
References ARENA_LOCK, and ARENA_UNLOCK.
| size_t arena_peak | ( | t_arena * | arena | ) |
Definition at line 175 of file arena_state.c.
References ARENA_LOCK, and ARENA_UNLOCK.
| void arena_pop | ( | t_arena * | arena, |
| t_arena_marker | marker | ||
| ) |
Definition at line 283 of file arena_state.c.
References ARENA_LOCK, arena_poison_memory, arena_report_error(), and ARENA_UNLOCK.
| size_t arena_remaining | ( | t_arena * | arena | ) |
Definition at line 122 of file arena_state.c.
References ARENA_LOCK, and ARENA_UNLOCK.
| void arena_reset | ( | t_arena * | arena | ) |
Definition at line 345 of file arena_state.c.
References ARENA_ASSERT_VALID, ARENA_LOCK, arena_poison_memory, and ARENA_UNLOCK.
| size_t arena_used | ( | t_arena * | arena | ) |
Definition at line 73 of file arena_state.c.
References ARENA_LOCK, ARENA_UNLOCK, and used.