Get raw pointers to referents without incrementing reference counts. This is used during GC to avoid reference count manipulation. tp_traverse visits objects without incref # Safety The returned pointers are only valid as long as the object is alive and its contents haven't been modified.
(&self)
| 1732 | /// The returned pointers are only valid as long as the object is alive |
| 1733 | /// and its contents haven't been modified. |
| 1734 | pub unsafe fn gc_get_referent_ptrs(&self) -> Vec<NonNull<PyObject>> { |
| 1735 | let mut result = Vec::new(); |
| 1736 | // Traverse the entire object including dict and slots |
| 1737 | self.0.traverse(&mut |child: &PyObject| { |
| 1738 | result.push(NonNull::from(child)); |
| 1739 | }); |
| 1740 | result |
| 1741 | } |
| 1742 | |
| 1743 | /// Pop edges from this object for cycle breaking. |
| 1744 | /// Returns extracted child references that were removed from this object (tp_clear). |
no test coverage detected