crosvm/cros_async
Daniel Verkamp f1885ff06b cros_async: uring_executor: create iovecs in one pass
The previous method required calling `get_volatile_slice()` twice for
each memory region - once to validate that each region is valid, and
again to convert the MemRegion into an IoBufMut. It also relied on
`get_volatile_slice()` returning the same non-Err value twice to avoid a
panic in the `unwrap()` used in the second pass.

Instead, we can iterate over the regions once and convert the iterator
directly into a pinned boxed slice.

BUG=None
TEST=tools/dev_container tools/presubmit
TEST=cargo test -p cros_async

Change-Id: I16e0bd38998b97e072a2d0fa5a72a2dea2d082f9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4646722
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-06-28 19:45:38 +00:00
..
src cros_async: uring_executor: create iovecs in one pass 2023-06-28 19:45:38 +00:00
tests cros_async: add TaskHandle docs and TaskHandle::cancel method 2023-05-31 00:47:23 +00:00
Cargo.toml