1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: move array.data to the top of the struct

This commit is contained in:
Alexander Medvednikov 2023-07-23 18:53:19 +03:00
parent 7cec70e525
commit b29a084257

View File

@ -10,14 +10,14 @@ import strings
// which avoids using generics and thus without generating extra // which avoids using generics and thus without generating extra
// code for every type. // code for every type.
pub struct array { pub struct array {
pub:
element_size int // size in bytes of one element in the array.
pub mut: pub mut:
data voidptr data voidptr
offset int // in bytes (should be `usize`), to avoid copying data while making slices, unless it starts changing offset int // in bytes (should be `usize`), to avoid copying data while making slices, unless it starts changing
len int // length of the array in elements. len int // length of the array in elements.
cap int // capacity of the array in elements. cap int // capacity of the array in elements.
flags ArrayFlags flags ArrayFlags
pub:
element_size int // size in bytes of one element in the array.
} }
[flag] [flag]