From 11e586494bb6c7dcdb0cd484711d4e6a9c606e55 Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Tue, 18 Jun 2024 12:46:50 +0200 Subject: [PATCH] Clarify that the arena in base:runtime shouldn't be used for anything but the default temp allocator. This is done by renaming the file in which it lives, and also by improving the comment above `Arena :: struct {`. This should avoid some confusion where people end up using the Arena in base:runtime because they thought it was the 'default arena'. --- ...allocators_arena.odin => default_temp_allocator_arena.odin} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename base/runtime/{default_allocators_arena.odin => default_temp_allocator_arena.odin} (98%) diff --git a/base/runtime/default_allocators_arena.odin b/base/runtime/default_temp_allocator_arena.odin similarity index 98% rename from base/runtime/default_allocators_arena.odin rename to base/runtime/default_temp_allocator_arena.odin index 571590f93..ab9f7df4a 100644 --- a/base/runtime/default_allocators_arena.odin +++ b/base/runtime/default_temp_allocator_arena.odin @@ -12,7 +12,8 @@ Memory_Block :: struct { capacity: uint, } -// NOTE: This is for internal use, prefer `Arena` from `core:mem/virtual` if necessary +// NOTE: This is a growing arena that is only used for the default temp allocator. +// For your own growing arena needs, prefer `Arena` from `core:mem/virtual`. Arena :: struct { backing_allocator: Allocator, curr_block: ^Memory_Block,