Message399426
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. |
|
Date |
User |
Action |
Args |
2021-08-12 00:19:22 | nascheme | set | recipients:
+ nascheme, vstinner, pablogsal |
2021-08-12 00:19:22 | nascheme | set | messageid: <1628727562.59.0.832233627755.issue44881@roundup.psfhosted.org> |
2021-08-12 00:19:22 | nascheme | link | issue44881 messages |
2021-08-12 00:19:22 | nascheme | create | |
|