In this example:
use std::mem::MaybeUninit;
extern {
fn fill(p: *mut u16);
}
pub unsafe fn test() {
let (mut buffer, mut buffer2): ([u16; 512], [u16; 256]) = MaybeUninit::uninit().assume_init();
fill(buffer.as_mut_ptr());
fill(buffer2.as_mut_ptr())
}
there is a call to memcpy for one of the buffers that copies uninitialized data to it.
https://rust.godbolt.org/z/z1zcor
In this example:
there is a call to
memcpyfor one of the buffers that copies uninitialized data to it.https://rust.godbolt.org/z/z1zcor