diff --git a/main.c b/main.c index 5199c45..357bd29 100644 --- a/main.c +++ b/main.c @@ -53,17 +53,23 @@ typedef struct WebArena size_t pos; } WebArena; +static bool next_arena_big = false; WebArena *web_arena_alloc() { WebArena *to_return = malloc(sizeof(to_return)); + size_t this_size = ARENA_SIZE; + if(next_arena_big) this_size = BIG_ARENA_SIZE; + *to_return = (WebArena) { - .data = calloc(1, ARENA_SIZE), - .cap = ARENA_SIZE, + .data = calloc(1, this_size), + .cap = this_size, .pos = 0, }; + next_arena_big = false; + return to_return; } @@ -2312,6 +2318,7 @@ void init(void) #endif frame_arena = MD_ArenaAlloc(); + next_arena_big = true; persistent_arena = MD_ArenaAlloc(); #ifdef DEVTOOLS diff --git a/todo.txt b/todo.txt index 15d0435..45b4500 100644 --- a/todo.txt +++ b/todo.txt @@ -1,3 +1,10 @@ +Very Important: + - Make sure no memory leaks in loading save data. I reuse the persistent arena, and just set the gamestate again, so all that memory allocated from loading the gamestate is leaked in the persistent arena. You need to fix this before ship. + + + +Below is old. + DONE - rewrite to have metadesk format for speech and actions DONE - action and item explanations in system message, along with available actions and items DONE - remove party eavesdropping, but make clear to AI when things are heard physically or told directly. Allow AI to choose people in vicinity to target with conversation and action. I.e a `talking_to` field. Also add a required character: field in chatgpt response, and make sure it matches the character it's supposed to act as. diff --git a/tuning.h b/tuning.h index 09420ec..6af08f5 100644 --- a/tuning.h +++ b/tuning.h @@ -13,6 +13,7 @@ #define SECONDS_PER_ARROW 1.3f #define ARENA_SIZE (1024*1024) +#define BIG_ARENA_SIZE (ARENA_SIZE * 8) #ifdef DEVTOOLS // server url cannot have trailing slash