MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / PyObject_IS_GC

Function PyObject_IS_GC

python27-sys/src/objimpl.rs:57–63  ·  view source on GitHub ↗
(o: *mut PyObject)

Source from the content-addressed store, hash-verified

55/// Test if an object has a GC head
56#[inline(always)]
57pub unsafe fn PyObject_IS_GC(o: *mut PyObject) -> c_int {
58 (PyType_IS_GC(Py_TYPE(o)) != 0
59 && match (*Py_TYPE(o)).tp_is_gc {
60 Some(tp_is_gc) => tp_is_gc(o) != 0,
61 None => true,
62 }) as c_int
63}
64
65/* Test if a type supports weak references */
66#[inline(always)]

Callers

nothing calls this directly

Calls 2

PyType_IS_GCFunction · 0.70
Py_TYPEFunction · 0.70

Tested by

no test coverage detected