crosvm/common
Daniel Verkamp 13505b2b9e data_model: eliminate unsafe code in zerocopy_from_reader()
Rather than using MaybeUninit to create a zeroed instance of a type and
std::slice::from_raw_parts_mut() to get a mutable &[u8] referring to it,
we can use the zerocopy 0.7 FromZeroes trait new_zeroed() function and
the AsBytes + FromBytes as_bytes_mut() function to read from the reader
into the type as a mutable &[u8].

This removes all of the unsafe code in the zerocopy_from_reader()
function.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: I76b12b69b02e807a3e52ac9b9e7e7165ee1f55f4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4939612
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-10-16 17:49:03 +00:00
..
audio_streams Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
balloon_control
data_model data_model: eliminate unsafe code in zerocopy_from_reader() 2023-10-16 17:49:03 +00:00
sync
chromeos_warning.md
README.md Replace internal p9 with crates.io versio 2023-08-14 18:34:51 +00:00

Crosvm General Purpose Libraries

The crates in this folder are general purpose libraries used by other projects in ChromeOS as well.

To make them accessible independendly of crosvm, each of these crates is excluded from the crosvm workspace.