|
@@ -51,7 +51,7 @@ arena_init_growing :: proc(arena: ^Arena, reserved: uint = DEFAULT_ARENA_GROWING
|
|
// Initialization of an `Arena` to be a `.Static` variant.
|
|
// Initialization of an `Arena` to be a `.Static` variant.
|
|
// A static arena contains a single `Memory_Block` allocated with virtual memory.
|
|
// A static arena contains a single `Memory_Block` allocated with virtual memory.
|
|
@(require_results)
|
|
@(require_results)
|
|
-arena_init_static :: proc(arena: ^Arena, reserved: uint, commit_size: uint = DEFAULT_ARENA_STATIC_COMMIT_SIZE) -> (err: Allocator_Error) {
|
|
|
|
|
|
+arena_init_static :: proc(arena: ^Arena, reserved: uint = DEFAULT_ARENA_STATIC_RESERVE_SIZE, commit_size: uint = DEFAULT_ARENA_STATIC_COMMIT_SIZE) -> (err: Allocator_Error) {
|
|
arena.kind = .Static
|
|
arena.kind = .Static
|
|
arena.curr_block = memory_block_alloc(commit_size, reserved, {}) or_return
|
|
arena.curr_block = memory_block_alloc(commit_size, reserved, {}) or_return
|
|
arena.total_used = 0
|
|
arena.total_used = 0
|