use std::ptr::NonNull;
use crate::{GcHead, GcHeap, GcPartitionId};
impl GcHead {
#[deprecated]
pub fn xref(&self) -> GcPartitionId {
let p = (self.partition >> 16) as u16;
GcPartitionId(p)
}
#[deprecated]
pub(crate) fn set_xref(&mut self, xref: GcPartitionId) -> bool {
if !xref.is_null() && xref != self.partition_id() {
log::trace!("[set_xref] {xref:?} -> {self:?}");
self.partition = (self.partition & 0x0000_FFFF) | ((xref.0 as u32) << 16);
true
} else {
self.partition &= 0x0000_FFFF;
false
}
}
#[deprecated]
#[inline(always)]
pub fn unset_xref(&mut self) {
self.set_xref(GcPartitionId::NONE);
}
}
impl GcHeap {
#[deprecated]
pub const fn set_xref(&mut self, from_scope: GcPartitionId, node: NonNull<GcHead>) -> bool {
false
}
}