mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-22 04:25:21 +00:00
vm-virtio: Replace use of deprecated std::mem::uninitialized
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
3c715daa9d
commit
ff36fa99e6
@ -66,7 +66,7 @@ impl TxBuf {
|
||||
// Using uninitialized memory here is quite safe, since we never read from any
|
||||
// area of the buffer before writing to it. First we push, then we flush only
|
||||
// what had been prviously pushed.
|
||||
Box::new(unsafe {mem::uninitialized::<[u8; Self::SIZE]>()}));
|
||||
Box::new(unsafe {mem::MaybeUninit::<[u8; Self::SIZE]>::uninit().assume_init()}));
|
||||
|
||||
// Buffer head, as an offset into the data slice.
|
||||
let head_ofs = self.head.0 as usize % Self::SIZE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user