Skip to content

Commit

Permalink
add TODO comments about INCREF and DECREF in free-threaded build
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed Aug 14, 2024
1 parent f695203 commit 848c793
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyo3-ffi/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 848c793

Please sign in to comment.