From d70d2a9da2784502cafc5acd5329cedd8b1e7dbf Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 1 Oct 2025 16:21:28 +0100 Subject: [PATCH] Added some bits for arena allocator work --- README.org | 6 ++++++ src/arena_allocator.c | 2 +- src/main.c | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 4984564..4b0860f 100644 --- a/README.org +++ b/README.org @@ -6,3 +6,9 @@ - [ ] implement textures and simple lighting - [ ] Figure out a simple game to make with this engine +* TODO Arena Allocator Requirements + - [ ] Sub arenas + - [ ] contiguos memory spaces for dynamic arrays that grow larger than the arena size +** Optional + - [ ] free lists to reuse abandoned chunks of memory arenas + diff --git a/src/arena_allocator.c b/src/arena_allocator.c index 591dd8d..e5b6b9c 100644 --- a/src/arena_allocator.c +++ b/src/arena_allocator.c @@ -3,7 +3,7 @@ #include #include -#define DEFAULT_ARENA_SIZE 1048576 /* 8 * 1024 * 1024 : 8MB*/ +#define DEFAULT_ARENA_SIZE 1048576 /* 8 * 1024 * 1024 = 8MB */ Arena arena_init(size_t capacity) { if (capacity == 0) { diff --git a/src/main.c b/src/main.c index 34c3a86..77fcffc 100644 --- a/src/main.c +++ b/src/main.c @@ -9,7 +9,6 @@ #include "window.h" int main(int argc, char *argv[]) { - wn_window window = {0}; if (!wn_window_init(&window)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize wn_window");