Message399359
Extensions that call PyObject_GC_UnTrack before calling Py_TRASHCAN_BEGIN will still work, they will just take a very minor performance hit. I don't think it is worth the trouble to introduce new macros for that reason. Extensions that really care about performance can wrap the call in a Python version ifdef.
There is an issue if someone writes and tests their extension with the new API, i.e. without having the explicit PyObject_GC_UnTrack() call in their dealloc method. If they compile with an older Python, they likely get a crash. If they compile with asserts enable, they would get an assert fail in _PyTrash_thread_deposit_object, i.e.:
_PyObject_ASSERT(op, !_PyObject_GC_IS_TRACKED(op));
I guess that's an argument for new macros. |
|
Date |
User |
Action |
Args |
2021-08-10 22:02:12 | nascheme | set | recipients:
+ nascheme, pablogsal |
2021-08-10 22:02:12 | nascheme | set | messageid: <1628632932.87.0.172171377817.issue44881@roundup.psfhosted.org> |
2021-08-10 22:02:12 | nascheme | link | issue44881 messages |
2021-08-10 22:02:12 | nascheme | create | |
|