prick_arena: shorthand

This commit is contained in:
2026-03-17 21:04:31 +00:00
parent 65c424530f
commit 88cfe77b5f

View File

@@ -9,6 +9,11 @@
#include "prick_arena.h"
in one of your code units.
To remove the `prick_` namespacing, please put:
#define PRICK_SHORTHAND
in any files before including prick_arena.h. Standard preprocesser rules apply
with regards to hierarchy.
This library defines both:
- A simple bump allocator for regions, with the ability to attach more regions
via a linked list in case the current region when the current region is full.
@@ -190,6 +195,17 @@ void prick_arena_free(prick_arena_t *arena)
#endif
#ifdef PRICK_SHORTHAND
typedef prick_arena_region_t arena_region_t;
typedef prick_arena_t arena_t;
#define arena_alloc prick_arena_alloc
#define arena_realloc prick_arena_realloc
#define arena_reset prick_arena_reset
#define arena_free prick_arena_free
#endif
#endif
/* Copyright (C) 2024 Aryadev Chavali