diff options
| author | thetarnav <gthetarnav@gmail.com> | 2025-11-02 14:20:55 +0100 |
|---|---|---|
| committer | thetarnav <gthetarnav@gmail.com> | 2025-11-02 14:20:55 +0100 |
| commit | 72754962ab6941c85a6bf373b18a149146461730 (patch) | |
| tree | 3c392aa1dba2df5922e9ed70eb03ae9b6f79aa73 /base/runtime | |
| parent | e364e76f7f8978ffef78321f962324a4fc4dcaae (diff) | |
Use resize_soa instead of resize proc group in soa procs
Diffstat (limited to 'base/runtime')
| -rw-r--r-- | base/runtime/core_builtin_soa.odin | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/base/runtime/core_builtin_soa.odin b/base/runtime/core_builtin_soa.odin index 5c3253f97..0ccc8fd9b 100644 --- a/base/runtime/core_builtin_soa.odin +++ b/base/runtime/core_builtin_soa.odin @@ -509,7 +509,7 @@ append_nothing_soa :: proc(array: ^$T/#soa[dynamic]$E, loc := #caller_location) return 0, nil } prev_len := len(array) - resize(array, len(array)+1, loc) or_return + resize_soa(array, len(array)+1, loc) or_return return len(array)-prev_len, nil } @@ -527,7 +527,8 @@ inject_at_elem_soa :: proc(array: ^$T/#soa[dynamic]$E, #any_int index: int, #no_ m :: 1 new_len := n + m - resize(array, new_len, loc) or_return + resize_soa(array, new_len, loc) or_return + when size_of(E) != 0 { ti := type_info_base(type_info_of(typeid_of(T))) si := &ti.variant.(Type_Info_Struct) @@ -553,6 +554,7 @@ inject_at_elem_soa :: proc(array: ^$T/#soa[dynamic]$E, #any_int index: int, #no_ item_offset += type.size } } + ok = true return } @@ -575,7 +577,8 @@ inject_at_elems_soa :: proc(array: ^$T/#soa[dynamic]$E, #any_int index: int, #no m := len(args) new_len := n + m - resize(array, new_len, loc) or_return + resize_soa(array, new_len, loc) or_return + when size_of(E) != 0 { ti := type_info_base(type_info_of(typeid_of(T))) si := &ti.variant.(Type_Info_Struct) @@ -604,6 +607,7 @@ inject_at_elems_soa :: proc(array: ^$T/#soa[dynamic]$E, #any_int index: int, #no item_offset += type.size } } + ok = true return } |