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

Function Py_CLEAR

python27-sys/src/object.rs:816–822  ·  view source on GitHub ↗
(op: &mut *mut PyObject)

Source from the content-addressed store, hash-verified

814
815#[inline(always)]
816pub unsafe fn Py_CLEAR(op: &mut *mut PyObject) {
817 let tmp = *op;
818 if !tmp.is_null() {
819 *op = ptr::null_mut();
820 Py_DECREF(tmp);
821 }
822}
823
824#[inline(always)]
825pub unsafe fn Py_XINCREF(op: *mut PyObject) {

Callers

nothing calls this directly

Calls 1

Py_DECREFFunction · 0.70

Tested by

no test coverage detected