pub(super) struct TotalQtyNotifier {
total_used: TotalQty,
reclamation_task_wakeup: Sender<()>,
}Expand description
Wrapper for TotalQty
Fields§
§total_used: TotalQtyTotal memory usage
Invariant: equal to
Σ Σ PRecord.used
ARecord PRecordreclamation_task_wakeup: Sender<()>Condvar to wake up the reclamation task
The reclamation task has another clone of this
Implementations§
Source§impl TotalQtyNotifier
impl TotalQtyNotifier
Sourcepub(super) fn new_zero(reclamation_task_wakeup: Sender<()>) -> Self
pub(super) fn new_zero(reclamation_task_wakeup: Sender<()>) -> Self
Make a new TotalQtyNotifier, which will notify a specified condvar
Sourcepub(super) fn claim(
&mut self,
precord: &mut PRecord,
want: Qty,
config: &ConfigInner,
) -> Result<ClaimedQty>
pub(super) fn claim( &mut self, precord: &mut PRecord, want: Qty, config: &ConfigInner, ) -> Result<ClaimedQty>
Record that some memory has been (or will be) allocated by a participant
Signals the wakeup task if we need to.
Sourcepub(super) fn maybe_wakeup(&mut self, config: &ConfigInner)
pub(super) fn maybe_wakeup(&mut self, config: &ConfigInner)
Check to see if we need to wake up the reclamation task, and if so, do so
Sourcepub(super) fn set_poisoned(&mut self)
pub(super) fn set_poisoned(&mut self)
Declare this poisoned, and prevent further claims
Sourcepub(super) fn release(&mut self, precord: &mut PRecord, have: ClaimedQty)
pub(super) fn release(&mut self, precord: &mut PRecord, have: ClaimedQty)
Record that some memory has been (or will be) freed by a participant
Trait Implementations§
Source§impl Debug for TotalQtyNotifier
impl Debug for TotalQtyNotifier
Auto Trait Implementations§
impl Freeze for TotalQtyNotifier
impl !RefUnwindSafe for TotalQtyNotifier
impl Send for TotalQtyNotifier
impl Sync for TotalQtyNotifier
impl Unpin for TotalQtyNotifier
impl UnsafeUnpin for TotalQtyNotifier
impl !UnwindSafe for TotalQtyNotifier
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more