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
Date 2021-08-10.22:02:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1628632932.87.0.172171377817.issue44881@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-08-10 22:02:12naschemesetrecipients: + nascheme, pablogsal
2021-08-10 22:02:12naschemesetmessageid: <1628632932.87.0.172171377817.issue44881@roundup.psfhosted.org>
2021-08-10 22:02:12naschemelinkissue44881 messages
2021-08-10 22:02:12naschemecreate