Neil Schemenauer <nas-pyt...@arctrix.com> added the comment:
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.

----------
stage: patch review -> needs patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44881>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to