pub struct HeapId(/* private fields */);Expand description
The identity of the heap that owns an allocation.
Every Heap mints one at construction (and a fresh one at
reset), and every header it allocates carries it. That makes “is this
object mine?” an O(1) test the collector can run before it dereferences
anything the header points at — which is what lets Heap::mark reject a
root belonging to another heap, or a header the sweep has already poisoned.
NonZeroU32 because 0 is reserved as the poisoned/unowned encoding in the
header’s heap_id field.
Implementations§
Trait Implementations§
impl Copy for HeapId
impl Eq for HeapId
impl StructuralPartialEq for HeapId
Auto Trait Implementations§
impl Freeze for HeapId
impl RefUnwindSafe for HeapId
impl Send for HeapId
impl Sync for HeapId
impl Unpin for HeapId
impl UnsafeUnpin for HeapId
impl UnwindSafe for HeapId
Blanket Implementations§
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