mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 13:23:08 +00:00
f4d6014c41
We can use MaybeUninit instead of heap allocation to ensure that our buffer has the proper size and alignment. `from_reader` is used for every message in the fs device and this saves us some unnecessary small heap allocations. Switch Reader::read_obj to use this method so that we don't have multiple implementations of the same thing. This also fixes some unsoundness in read_obj where we were creating a `&mut [u8]` out of uninitialized data. BUG=none TEST=unit tests Change-Id: I1fa66de11974e2fe3a8dfb4b7ab4b210ecf395d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3109088 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |