pub(crate) struct TrackedReservation {
reservation: Mutex<Option<Box<dyn MemoryReservation>>>,
}Expand description
This is a wrapper for the reservation so we can standardize on changing and avoid race conditions in memory accounting
Fields§
§reservation: Mutex<Option<Box<dyn MemoryReservation>>>Implementations§
Source§impl TrackedReservation
impl TrackedReservation
Sourcepub fn claim(&self, pool: &dyn MemoryPool, capacity: usize)
pub fn claim(&self, pool: &dyn MemoryPool, capacity: usize)
Claim memory from a pool, replacing the current reservation (if exists).
Sourcepub fn resize(&self, new_size: usize)
pub fn resize(&self, new_size: usize)
Resize the memory reservation of this buffer
This is a no-op if this buffer doesn’t have a reservation.
Trait Implementations§
Source§impl Debug for TrackedReservation
impl Debug for TrackedReservation
Auto Trait Implementations§
impl !Freeze for TrackedReservation
impl RefUnwindSafe for TrackedReservation
impl Send for TrackedReservation
impl Sync for TrackedReservation
impl Unpin for TrackedReservation
impl UnsafeUnpin for TrackedReservation
impl UnwindSafe for TrackedReservation
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more