mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 10:10:41 +00:00
aa2e59d82f
Although it can be useful for some limited cases, the Descriptor wrapper class should ideally be eschewed and an alternative based on implementing AsRawDescriptor on the right type be preferred. Make sure its documentation reflects that. The reason for avoiding Descriptor is that it encourages storing raw descriptors that can possibly be closed before the user expects it. A reasonable alternative to doing this is to call as_raw_descriptor() at the exact moment the descriptor is needed, and never storing the result - this ensures that the providing object (and underlying descriptor) remain alive for long enough. Update the documentation of AsRawDescriptor to explain and hopefully encourage this practice. BUG=233968702 TEST=cargo build Change-Id: I91c2ef11152b3b6adcc25f40d6de0a0f131700dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3670101 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Alexandre Courbot <acourbot@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dennis Kempin <denniskempin@google.com> |
||
---|---|---|
.. | ||
base_poll_token_derive | ||
src | ||
.build_test_serial | ||
Cargo.toml |