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

Method gc_get_referents

crates/vm/src/object/core.rs:1684–1690  ·  view source on GitHub ↗

Get the referents (objects directly referenced) of this object. Uses the full traverse including dict and slots.

(&self)

Source from the content-addressed store, hash-verified

1682 /// Get the referents (objects directly referenced) of this object.
1683 /// Uses the full traverse including dict and slots.
1684 pub fn gc_get_referents(&self) -> Vec<PyObjectRef> {
1685 let mut result = Vec::new();
1686 self.0.traverse(&mut |child: &PyObject| {
1687 result.push(child.to_owned());
1688 });
1689 result
1690 }
1691
1692 /// Call __del__ if present, without triggering object deallocation.
1693 /// Used by GC to call finalizers before breaking cycles.

Callers 1

get_referentsFunction · 0.80

Calls 4

newFunction · 0.85
traverseMethod · 0.45
pushMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected