mirror of
https://github.com/odin-lang/Odin.git
synced 2026-09-23 21:46:00 -04:00
Add clear_soa (for #soa[dynamic]T)
This commit is contained in:
1 parent
18776aa6b9
commit
75a2015260
1 file changed
+13
@@ -413,3 +413,16 @@ delete_soa :: proc{
|
||||
delete_soa_slice,
|
||||
delete_soa_dynamic_array,
|
||||
}
|
||||
|
||||
|
||||
clear_soa_dynamic_array :: proc(array: ^$T/#soa[dynamic]$E) {
|
||||
when intrinsics.type_struct_field_count(E) != 0 {
|
||||
footer := raw_soa_footer(array)
|
||||
footer.len = 0
|
||||
}
|
||||
}
|
||||
|
||||
@builtin
|
||||
clear_soa :: proc{
|
||||
clear_soa_dynamic_array,
|
||||
}
|
||||
Reference in new issue
Block a user