#[cfg(all(loom, any(test, feature = "loom")))] mod inner { pub(crate) mod atomic { pubuse loom::sync::atomic::*; pubuse std::sync::atomic::Ordering;
} pub(crate) use loom::{
cell::UnsafeCell, hint, lazy_static, sync::Mutex, thread::yield_now, thread_local,
};
pub(crate) mod alloc { #![allow(dead_code)] use loom::alloc; use std::fmt; /// Track allocations, detecting leaks /// /// This is a version of `loom::alloc::Track` that adds a missing /// `Default` impl. pubstruct Track<T>(alloc::Track<T>);
impl<T> Track<T> { /// Track a value for leaks #[inline(always)] pubfn new(value: T) -> Track<T> {
Track(alloc::Track::new(value))
}
/// Get a reference to the value #[inline(always)] pubfn get_ref(&self) -> &T { self.0.get_ref()
}
/// Get a mutable reference to the value #[inline(always)] pubfn get_mut(&mutself) -> &mut T { self.0.get_mut()
}
/// Stop tracking the value for leaks #[inline(always)] pubfn into_inner(self) -> T { self.0.into_inner()
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.