mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +00:00
devices: queue: Keep clone of mem instead of Rc
GuestMemory is just Arcs, cloning it is as cheap as keeping an Rc. Change-Id: I160585ce0cf70aa0ec33897b550b82fe09bde2a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2364992 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
parent
2e8f355ba0
commit
7ca98fb599
1 changed files with 2 additions and 2 deletions
|
@ -505,13 +505,13 @@ impl Queue {
|
|||
/// re-enabled on drop.
|
||||
pub struct NotifyGuard {
|
||||
queue: Rc<RefCell<Queue>>,
|
||||
mem: Rc<GuestMemory>,
|
||||
mem: GuestMemory,
|
||||
}
|
||||
|
||||
impl NotifyGuard {
|
||||
/// Disable notifications for the lifetime of the returned guard. Useful when the caller is
|
||||
/// processing a descriptor and doesn't need notifications of further messages from the guest.
|
||||
pub fn new(queue: Rc<RefCell<Queue>>, mem: Rc<GuestMemory>) -> Self {
|
||||
pub fn new(queue: Rc<RefCell<Queue>>, mem: GuestMemory) -> Self {
|
||||
// Disable notification until we're done processing the next request.
|
||||
queue.borrow_mut().set_notify(&mem, false);
|
||||
NotifyGuard { queue, mem }
|
||||
|
|
Loading…
Reference in a new issue