This function calls memset:
fn create_uninit_array() -> [[MaybeUninit<u8>; 4]; 200] {
[[MaybeUninit::<u8>::uninit(); 4]; 200]
}
and this one doesn't:
fn create_uninit_array_fast() -> [MaybeUninit<u8>; 800] {
[MaybeUninit::<u8>::uninit(); 800]
}
I would have expected the same assembly to be generated for both cases.
See on Godbolt
This function calls
memset:and this one doesn't:
I would have expected the same assembly to be generated for both cases.
See on Godbolt