MCPcopy Index your code
hub / github.com/dgrunwald/rust-cpython / Py_CLEAR

Function Py_CLEAR

python3-sys/src/object.rs:917–923  ·  view source on GitHub ↗
(op: &mut *mut PyObject)

Source from the content-addressed store, hash-verified

915
916#[inline(always)]
917pub unsafe fn Py_CLEAR(op: &mut *mut PyObject) {
918 let tmp = *op;
919 if !tmp.is_null() {
920 *op = ptr::null_mut();
921 Py_DECREF(tmp);
922 }
923}
924
925#[inline(always)]
926pub unsafe fn Py_XINCREF(op: *mut PyObject) {

Callers

nothing calls this directly

Calls 1

Py_DECREFFunction · 0.70

Tested by

no test coverage detected