Skip to content

GH-127705: Revert "Move mortal decrefs to internal header and make sure _PyReftracerTrack is called" #131500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

encukou
Copy link
Member

@encukou encukou commented Mar 20, 2025

This reverts commit fd545d7,
which broke Py_TRACE_REFS builds.

…ake sure _PyReftracerTrack is called"

This broke Py_TRACE_REFS builds.
This reverts commit fd545d7.
@colesbury
Copy link
Contributor

This is easy to fix. _Py_Dealloc() is responsible for _Py_ForgetReference() so we only should include it manually if we're not going to call _Py_Dealloc().

diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h
index 08cbfe46b0d..30b88404bbe 100644
--- a/Include/internal/pycore_object.h
+++ b/Include/internal/pycore_object.h
@@ -445,9 +445,6 @@ static inline void Py_DECREF_MORTAL(const char *filename, int lineno, PyObject *
         _Py_DECREF_DecRefTotal();
     }
     if (--op->ob_refcnt == 0) {
-#ifdef Py_TRACE_REFS
-        _Py_ForgetReference(op);
-#endif
         _Py_Dealloc(op);
     }
 }

@markshannon
Copy link
Member

Thanks Sam

#131508

@vstinner
Copy link
Member

Issue fixed by 684a759, this revert is no longer needed.

@vstinner vstinner closed this Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants