This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nascheme
Recipients nascheme, pablogsal, vstinner
Date 2021-08-12.00:19:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1628727562.59.0.832233627755.issue44881@roundup.psfhosted.org>
In-reply-to
Content
I was thinking about this more today and I think the better fix is to actually build the trashcan mechanism into _Py_Dealloc().  Requiring that types opt-in to the trashcan mechanism by using the trashcan macros is not ideal.  

First, the trashcan macros are a bit tricky to use correctly.  Second, every "container" type is potentially a part of a long ref chain and could blow up the stack on deallocation (i.e. triggered from DECREF).  So, for correctness/robustness, every type that supports cyclic GC should get trashcan-style deallocation.

We would have to find a way to do this without incurring a (significant) performance hit.  Also, it would have to be done without breaking C extensions.  Ideally they would get trashcan-style deallocation without any source code changes.  I'm not sure if that can be done but I'm hopeful it's possible.
History
Date User Action Args
2021-08-12 00:19:22naschemesetrecipients: + nascheme, vstinner, pablogsal
2021-08-12 00:19:22naschemesetmessageid: <1628727562.59.0.832233627755.issue44881@roundup.psfhosted.org>
2021-08-12 00:19:22naschemelinkissue44881 messages
2021-08-12 00:19:22naschemecreate