MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / resurrect

Method resurrect

aiscript-arena/src/gc_weak.rs:81–90  ·  view source on GitHub ↗
(self, fc: &Finalization<'gc>)

Source from the content-addressed store, hash-verified

79 /// be dropped this collection cycle.
80 #[inline]
81 pub fn resurrect(self, fc: &Finalization<'gc>) -> Option<Gc<'gc, T>> {
82 // SAFETY: We know that we are currently marking, so any non-dropped pointer is safe to
83 // resurrect.
84 if unsafe { self.inner.ptr.as_ref() }.header.is_live() {
85 Gc::resurrect(fc, self.inner);
86 Some(self.inner)
87 } else {
88 None
89 }
90 }
91
92 /// Returns true if two `GcWeak`s point to the same allocation.
93 ///

Callers

nothing calls this directly

Calls 2

is_liveMethod · 0.80
as_refMethod · 0.45

Tested by

no test coverage detected