From 848c7934f4a455891f9803787553c948130e5475 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Wed, 14 Aug 2024 13:53:49 -0600 Subject: [PATCH] add TODO comments about INCREF and DECREF in free-threaded build --- pyo3-ffi/src/object.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyo3-ffi/src/object.rs b/pyo3-ffi/src/object.rs index f7be0d7139b..9baebb8a51f 100644 --- a/pyo3-ffi/src/object.rs +++ b/pyo3-ffi/src/object.rs @@ -556,6 +556,7 @@ extern "C" { #[inline(always)] pub unsafe fn Py_INCREF(op: *mut PyObject) { // On limited API, the free-threaded build, or with refcount debugging, let the interpreter do refcounting + // TODO: reimplement the logic in the header in the free-threaded build, for a little bit of performance. #[cfg(any( Py_GIL_DISABLED, Py_LIMITED_API, @@ -619,6 +620,7 @@ pub unsafe fn Py_INCREF(op: *mut PyObject) { pub unsafe fn Py_DECREF(op: *mut PyObject) { // On limited API, the free-threaded build, or with refcount debugging, let the interpreter do refcounting // On 3.12+ we implement refcount debugging to get better assertion locations on negative refcounts + // TODO: reimplement the logic in the header in the free-threaded build, for a little bit of performance. #[cfg(any( Py_GIL_DISABLED, Py_LIMITED_API,