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

Method drop

crates/vm/src/object/ext.rs:250–259  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

248
249impl<T> Drop for PyAtomicRef<T> {
250 fn drop(&mut self) {
251 // SAFETY: We are dropping the atomic reference, so we can safely
252 // release the pointer.
253 unsafe {
254 let ptr = Radium::swap(&self.inner, null_mut(), Ordering::Relaxed);
255 if let Some(ptr) = NonNull::<PyObject>::new(ptr.cast()) {
256 let _: PyObjectRef = PyObjectRef::from_raw(ptr);
257 }
258 }
259 }
260}
261
262cfg_if::cfg_if! {

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
castMethod · 0.45

Tested by

no test coverage detected