|
memory_arena
|
Cleanup and teardown routines for memory arenas. More...
#include "arena.h"
Include dependency graph for arena_cleanup.c:Go to the source code of this file.
Functions | |
| void | arena_delete (t_arena **arena) |
| void | arena_destroy (t_arena *arena) |
| static void | arena_free_buffer_if_owned (t_arena *arena) |
| Free the arena's internal buffer if the arena owns it. | |
| static void | arena_free_growth_history (t_arena *arena) |
| Free the memory used to store the arena's growth history. | |
Cleanup and teardown routines for memory arenas.
This file provides functions to safely destroy and deallocate arena resources, including internal memory buffers, metadata like growth history, and synchronization primitives. It ensures proper cleanup whether the arena is heap-allocated or stack-allocated.
API functions included:
arena_destroy)arena_delete)These functions are used internally and publicly to manage arena lifecycles and to ensure memory safety, thread-safety, and diagnostic cleanliness.
Definition in file arena_cleanup.c.
| void arena_delete | ( | t_arena ** | arena | ) |
Definition at line 148 of file arena_cleanup.c.
References arena_destroy().
| void arena_destroy | ( | t_arena * | arena | ) |
Definition at line 82 of file arena_cleanup.c.
References ARENA_CHECK, arena_free_buffer_if_owned(), arena_free_growth_history(), ARENA_LOCK, ARENA_UNLOCK, and arena_zero_metadata().