1use std::ptr::NonNull;
5
6use crate::{GcHead, GcHeap, GcPartitionId};
7
8impl GcHead {
9 #[deprecated]
11 pub fn xref(&self) -> GcPartitionId {
12 let p = (self.partition >> 16) as u16;
13 GcPartitionId(p)
14 }
15
16 #[deprecated]
23 pub(crate) fn set_xref(&mut self, xref: GcPartitionId) -> bool {
24 if !xref.is_null() && xref != self.partition_id() {
25 log::trace!("[set_xref] {xref:?} -> {self:?}");
26 self.partition = (self.partition & 0x0000_FFFF) | ((xref.0 as u32) << 16);
27 true
28 } else {
29 self.partition &= 0x0000_FFFF;
30 false
31 }
32 }
33
34 #[deprecated]
36 #[inline(always)]
37 pub fn unset_xref(&mut self) {
38 self.set_xref(GcPartitionId::NONE);
39 }
40}
41
42impl GcHeap {
43 #[deprecated]
44 pub const fn set_xref(&mut self, from_scope: GcPartitionId, node: NonNull<GcHead>) -> bool {
45 false
46 }
47}