| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
For subtle reasons, PyObject_GC_UnTrack() function must be called before Py_TRASHCAN_BEGIN(). There have been a number of bugs over the years related to not doing this particular dance just right. Integrating the PyObject_GC_UnTrack() call makes it harder to do things incorrectly. That avoids some hard to find bugs (e.g. only triggered when object nesting gets deep enough). Extensions that still call PyObject_GC_UnTrack() explictly will still work correctly but the call is unneeded after this change. It would still be needed for the extension to work correctly with older versions of Python.
|
Let's land #27678 first to include that change in this PR |
Sorry, something went wrong.
|
Just to be clear, I don't consider this PR a bugfix and it would not be appropriate to include in 3.10. |
Sorry, something went wrong.
Yep, we are on the same page :) |
Sorry, something went wrong.
It seems slightly cleaner to have the BEGIN/END macros at the start and end of the dealloc function body.
|
We won't be merging this as of yet because an alternative solution is evaluated in GH-27738. I added the assert Victor wanted so that the benchmarks are fairer between the two approaches. |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
This PR is out of date and will not be required if GH-132280 gets merged. That PR integrates the trashcan mechanism into Py_Dealloc and also stops using the GC next/prev pointers to store the queue of trash. So, it removes the need to call PyObject_GC_UnTrack() at the exact right time. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
For subtle reasons, PyObject_GC_UnTrack() function must be called before
Py_TRASHCAN_BEGIN(). There have been a number of bugs over the years
related to not doing this particular dance just right. Integrating
the PyObject_GC_UnTrack() call makes it harder to do things incorrectly.
That avoids some hard to find bugs (e.g. only triggered when object
nesting gets deep enough).
Extensions that still call PyObject_GC_UnTrack() explictly will
work correctly but the call is unneeded after this change. It would
still be needed for the extension to work correctly with older versions
of Python.
https://bugs.python.org/issue44881