From aed7d1b7ac340c19656059c9cbd94aff40952f83 Mon Sep 17 00:00:00 2001 From: Omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Fri, 3 May 2024 21:37:51 +1000 Subject: create logical device --- src/std/mem.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/std/mem.h') diff --git a/src/std/mem.h b/src/std/mem.h index 2f92894..bbfb852 100644 --- a/src/std/mem.h +++ b/src/std/mem.h @@ -18,9 +18,16 @@ typedef struct arena { char* end; } arena; +typedef struct arena_save { + arena* arena; + char* savepoint; +} arena_save; + arena arena_create(void* backing_buffer, size_t capacity); void* arena_alloc(arena* a, size_t size); void* arena_alloc_align(arena* a, size_t size, size_t align); void arena_free_all(arena* a); void arena_free_storage(arena* a); +arena_save arena_savepoint(arena* a); +void arena_rewind(arena_save savepoint); // TODO: arena_resize \ No newline at end of file -- cgit v1.2.3-70-g09d2