Skip to content

Commit

Permalink
Merge pull request #4510 from Kelimion/fix_4509
Browse files Browse the repository at this point in the history
Fix #4509
  • Loading branch information
Kelimion authored Nov 24, 2024
2 parents e607cbe + 56e4da8 commit 73ab881
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/runtime/core_builtin_soa.odin
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,15 @@ make_soa_slice :: proc($T: typeid/#soa[]$E, #any_int length: int, allocator := c
@(builtin, require_results)
make_soa_dynamic_array :: proc($T: typeid/#soa[dynamic]$E, allocator := context.allocator, loc := #caller_location) -> (array: T, err: Allocator_Error) #optional_allocator_error {
context.allocator = allocator
array.allocator = allocator
reserve_soa(&array, 0, loc) or_return
return array, nil
}

@(builtin, require_results)
make_soa_dynamic_array_len :: proc($T: typeid/#soa[dynamic]$E, #any_int length: int, allocator := context.allocator, loc := #caller_location) -> (array: T, err: Allocator_Error) #optional_allocator_error {
context.allocator = allocator
array.allocator = allocator
resize_soa(&array, length, loc) or_return
return array, nil
}
Expand Down

0 comments on commit 73ab881

Please sign in to comment.