fmt: fix alignment of struct init fields (#22025)

This commit is contained in:
yuyi 2024-08-11 14:11:24 +08:00 committed by GitHub
parent 99da5726db
commit c51d30bf53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
671 changed files with 18817 additions and 18787 deletions

View file

@ -80,13 +80,13 @@ fn system_page_size(_ voidptr) usize {
fn get_linux_allocator() dlmalloc.Allocator {
return dlmalloc.Allocator{
alloc: system_alloc
remap: system_remap
free_part: system_free_part
free_: system_free
alloc: system_alloc
remap: system_remap
free_part: system_free_part
free_: system_free
can_release_part: system_can_release_part
allocates_zeros: system_allocates_zeros
page_size: system_page_size
data: unsafe { nil }
allocates_zeros: system_allocates_zeros
page_size: system_page_size
data: unsafe { nil }
}
}

View file

@ -11,10 +11,10 @@ pub:
// for now off the stack
fn new_array_from_c_array(len int, cap int, elm_size int, c_array voidptr) array {
arr := array{
len: len
cap: cap
len: len
cap: cap
element_size: elm_size
data: c_array
data: c_array
}
return arr
}
@ -41,10 +41,10 @@ pub fn (a array) repeat(nr_repeats int) array {
assert nr_repeats >= 0
arr := array{
len: nr_repeats * a.len
cap: nr_repeats * a.len
len: nr_repeats * a.len
cap: nr_repeats * a.len
element_size: a.element_size
data: malloc(nr_repeats * a.len * a.element_size)
data: malloc(nr_repeats * a.len * a.element_size)
}
for i in 0 .. nr_repeats {
mem_copy(arr.data + i * a.len * a.element_size, a.data, a.len * a.element_size)