mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix small doc mistakes in arena.odin
This commit is contained in:
@@ -242,7 +242,7 @@ arena_growing_bootstrap_new_by_name :: proc($T: typeid, $field_name: string, min
|
|||||||
return arena_growing_bootstrap_new_by_offset(T, offset_of_by_string(T, field_name), minimum_block_size)
|
return arena_growing_bootstrap_new_by_offset(T, offset_of_by_string(T, field_name), minimum_block_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ability to bootstrap allocate a struct with an arena within the struct itself using the growing variant strategy.
|
// Ability to bootstrap allocate a struct with an arena within the struct itself using the static variant strategy.
|
||||||
@(require_results)
|
@(require_results)
|
||||||
arena_static_bootstrap_new_by_offset :: proc($T: typeid, offset_to_arena: uintptr, reserved: uint) -> (ptr: ^T, err: Allocator_Error) {
|
arena_static_bootstrap_new_by_offset :: proc($T: typeid, offset_to_arena: uintptr, reserved: uint) -> (ptr: ^T, err: Allocator_Error) {
|
||||||
bootstrap: Arena
|
bootstrap: Arena
|
||||||
@@ -258,7 +258,7 @@ arena_static_bootstrap_new_by_offset :: proc($T: typeid, offset_to_arena: uintpt
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ability to bootstrap allocate a struct with an arena within the struct itself using the growing variant strategy.
|
// Ability to bootstrap allocate a struct with an arena within the struct itself using the static variant strategy.
|
||||||
@(require_results)
|
@(require_results)
|
||||||
arena_static_bootstrap_new_by_name :: proc($T: typeid, $field_name: string, reserved: uint) -> (ptr: ^T, err: Allocator_Error) {
|
arena_static_bootstrap_new_by_name :: proc($T: typeid, $field_name: string, reserved: uint) -> (ptr: ^T, err: Allocator_Error) {
|
||||||
return arena_static_bootstrap_new_by_offset(T, offset_of_by_string(T, field_name), reserved)
|
return arena_static_bootstrap_new_by_offset(T, offset_of_by_string(T, field_name), reserved)
|
||||||
@@ -271,7 +271,7 @@ arena_allocator :: proc(arena: ^Arena) -> mem.Allocator {
|
|||||||
return mem.Allocator{arena_allocator_proc, arena}
|
return mem.Allocator{arena_allocator_proc, arena}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The allocator procedured by an `Allocator` produced by `arena_allocator`
|
// The allocator procedure used by an `Allocator` produced by `arena_allocator`
|
||||||
arena_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode,
|
arena_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode,
|
||||||
size, alignment: int,
|
size, alignment: int,
|
||||||
old_memory: rawptr, old_size: int,
|
old_memory: rawptr, old_size: int,
|
||||||
@@ -328,7 +328,7 @@ arena_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// An `Arena_Temp` is a way to produce temporary watermarks to reset a arena to a previous state.
|
// An `Arena_Temp` is a way to produce temporary watermarks to reset an arena to a previous state.
|
||||||
// All uses of an `Arena_Temp` must be handled by ending them with `arena_temp_end` or ignoring them with `arena_temp_ignore`.
|
// All uses of an `Arena_Temp` must be handled by ending them with `arena_temp_end` or ignoring them with `arena_temp_ignore`.
|
||||||
Arena_Temp :: struct {
|
Arena_Temp :: struct {
|
||||||
arena: ^Arena,
|
arena: ^Arena,
|
||||||
|
|||||||
Reference in New Issue
Block a user