Browse Source

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'.

Karl Zylinski 1 year ago
parent
commit
11e586494b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      base/runtime/default_temp_allocator_arena.odin

+ 2 - 1
base/runtime/default_allocators_arena.odin → 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,