19#ifndef ARENA_INTERNAL_H
20#define ARENA_INTERNAL_H
41#ifdef ARENA_ENABLE_THREAD_SAFE
42#define ARENA_LOCK(arena) \
45 if ((arena)->use_lock) \
46 pthread_mutex_lock(&(arena)->lock); \
54#define ARENA_UNLOCK(arena) \
57 if ((arena)->use_lock) \
58 pthread_mutex_unlock(&(arena)->lock); \
61#define ARENA_LOCK(arena) ((void) 0)
62#define ARENA_UNLOCK(arena) ((void) 0)
Core public API for the Arena memory allocator.
void arena_zero_metadata(t_arena *arena)
Zero out and reset all debug/stats metadata associated with the arena.
bool arena_is_valid(const t_arena *arena)
Check whether the given arena is in a valid, initialized state.
size_t default_grow_cb(size_t current_size, size_t requested_size)
Default growth policy callback for arena resizing.
void arena_update_peak(t_arena *arena)
Update the arena’s peak memory usage if the current usage exceeds it.
The main memory arena structure used for fast allocation.