mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 12:34:31 +00:00
13505b2b9e
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> |
||
---|---|---|
.. | ||
audio_streams | ||
balloon_control | ||
data_model | ||
sync | ||
chromeos_warning.md | ||
README.md |
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.