[issue44881] Consider integration of GC_UNTRACK with TRASHCAN

Neil Schemenauer report at bugs.python.org
Tue Aug 10 17:07:59 EDT 2021


New submission from Neil Schemenauer <nas-python at arctrix.com>:

The fix for bpo-33930 includes a somewhat mysterious comment:

    // The Py_TRASHCAN mechanism requires that we be able to
    // call PyObject_GC_UnTrack twice on an object.

I wonder if we can just integrate the untrack into the body of the trashcan code.  Then, the explicit call to untrack in the dealloc function body can be removed.  That removes the risk of incorrectly using the macro version.

I suspect the reason this was not done originally is because the original trashcan mechanism did not use the GC header pointers to store objects.  Now, any object that uses the trashcan *must* be a GC object.

----------
messages: 399356
nosy: nascheme
priority: normal
severity: normal
stage: needs patch
status: open
title: Consider integration of GC_UNTRACK with TRASHCAN
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44881>
_______________________________________


More information about the Python-bugs-list mailing list