From 8cdfe4829bee3b7d4fcb640ed698de36858f46d7 Mon Sep 17 00:00:00 2001 From: Kevin Trogant Date: Thu, 8 Jan 2026 18:13:16 +0100 Subject: [PATCH] MakeArena util --- rtcore.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rtcore.h b/rtcore.h index 09440a4..321c585 100644 --- a/rtcore.h +++ b/rtcore.h @@ -153,6 +153,20 @@ typedef struct arena_cp byte *cp; } arena_cp; +static force_inline arena +MakeArena(void *base, isize cap) +{ + return (cap > 0 && base != NULL) ? + (arena){ + .begin = (byte *)base, + .end = (byte *)base + cap, + } : + (arena){ + .begin = NULL, + .end = NULL + }; +} + static force_inline arena_cp SaveArena(arena a) {