1#ifndef ARENA_VISUALIZER_H
2#define ARENA_VISUALIZER_H
11#define MAX_HISTORY 200
12#define MAX_LABEL_LEN 128
Core public API for the Arena memory allocator.
Allocation hook system for arena-based memory tracking and introspection.
void arena_visualizer_error_callback(const char *msg, void *context)
void step_message(t_arena_visualizer *vis, const char *msg)
t_arena_history_entry history[MAX_HISTORY]
int wait_for_key(t_arena_visualizer *vis)
function that blocks reading keystrokes:
struct ncplane * main_plane
struct s_arena_history_entry t_arena_history_entry
Each ring-buffer event: error, step, normal or sub-alloc.
void arena_start_interactive_visualizer(t_arena_visualizer *vis, t_arena *arena)
Start the interactive session (blocks until user quits).
void arena_visualizer_enable_history_hook(t_arena_visualizer *vis, t_arena *arena)
Attach our allocation hook to an arena.
atomic_size_t history_index
atomic_size_t history_count
void draw_visualizer(t_arena_visualizer *vis)
char label[MAX_LABEL_LEN]
struct s_arena_visualizer t_arena_visualizer
The main interactive visualizer.
void arena_visualizer_allocation_hook(t_arena *arena, int id, void *ptr, size_t size, size_t offset, size_t wasted, const char *label)
The ring buffer hooks.
Each ring-buffer event: error, step, normal or sub-alloc.
The main interactive visualizer.
The main memory arena structure used for fast allocation.