-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
GH-127705: Handle trace refs in specialized decref #131198
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
GH-127705: Handle trace refs in specialized decref #131198
Conversation
!buildbot TraceRef |
🤖 New build scheduled with the buildbot fleet by @markshannon for commit b5eb234 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F131198%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be exposing Py_DECREF_MORTAL
and Py_DECREF_MORTAL_SPECIALIZED
to extensions when they include Python.h
. It seems to me like they belong in pycore_object.h
or some other internal-only header.
@@ -420,6 +420,9 @@ static inline void _Py_DECREF_MORTAL_SPECIALIZED(const char *filename, int linen | |||
_Py_DECREF_DecRefTotal(); | |||
} | |||
if (--op->ob_refcnt == 0) { | |||
#ifdef Py_TRACE_REFS | |||
_Py_ForgetReference(op); | |||
#endif | |||
destruct(op); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a _PyReftracerTrack(op, PyRefTracer_DESTROY);
I agree, but it is infeasible now due to cyclic includes. |
Merging as is, so we don't release with |
Can you please rename Py_DECREF_MORTAL_SPECIALIZED() to _Py_DECREF_MORTAL_SPECIALIZED() in the public C API? |
…1198) This is missing `_PyReftracerTrack` calls, see pythongh-131238. Merging as-is for the 3.14.0a6 release.
…1198) This is missing `_PyReftracerTrack` calls, see pythongh-131238. Merging as-is for the 3.14.0a6 release.
Adds a couple of
_Py_ForgetReference
s that were overlooked.