From 6e52a79ca2750a69466b3be8eece5e016620290d Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 6 Mar 2024 22:40:45 -0500 Subject: [PATCH] Compile fix for grime_arena --- code/grime_arena.odin | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/code/grime_arena.odin b/code/grime_arena.odin index dbf1bf8..7825494 100644 --- a/code/grime_arena.odin +++ b/code/grime_arena.odin @@ -4,6 +4,21 @@ This is an alternative to alleviates that. */ package sectr +import "core:mem" + +// Initialize a sub-section of our virtual memory as a sub-arena +sub_arena_init :: proc( address : ^ byte, size : int ) -> ( ^ Arena) { + Arena :: mem.Arena + + arena_size :: size_of( Arena) + sub_arena := cast( ^ Arena ) address + mem_slice := slice_ptr( ptr_offset( address, arena_size), size ) + arena_init( sub_arena, mem_slice ) + return sub_arena +} + +// TODO(Ed) : Once this is done (ArenaFixed), rename to just Arena as we're not going to use the core implementation + ArenaFixedHeader :: struct { data : []byte, offset : uint,