MCPcopy Index your code
hub / github.com/RustPython/RustPython / promote

Method promote

crates/vm/src/object/core.rs:1943–1950  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

1941 /// clears the borrow tag). No-op if already owned.
1942 #[inline(always)]
1943 pub fn promote(&mut self) {
1944 if self.is_borrowed() {
1945 self.as_object().0.ref_count.inc();
1946 // SAFETY: clearing the low bit of a non-null pointer keeps it non-zero
1947 self.bits =
1948 unsafe { NonZeroUsize::new_unchecked(self.bits.get() & !STACKREF_BORROW_TAG) };
1949 }
1950 }
1951}
1952
1953impl Drop for PyStackRef {

Callers

nothing calls this directly

Calls 4

is_borrowedMethod · 0.45
incMethod · 0.45
as_objectMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected