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 vstinner
Recipients vstinner
Date 2020-06-22.08:38:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1592815094.33.0.264745776024.issue41073@roundup.psfhosted.org>
In-reply-to
Content
To fix bpo-40170, I would like to modify Py_TRASHCAN_BEGIN() macro to use PyType_GetSlot() to get the deallocator function, rather than accessing directly the PyTypeObject.tp_dealloc member. The problem is that currently PyType_GetSlot() only works on heap allocated types.

Would it be possible to add support for statically allocated types to PyType_GetSlot()?

Py_TRASHCAN_BEGIN() is currently defined as:

#define Py_TRASHCAN_BEGIN(op, dealloc) \
    Py_TRASHCAN_BEGIN_CONDITION(op, \
        Py_TYPE(op)->tp_dealloc == (destructor)(dealloc))
History
Date User Action Args
2020-06-22 08:38:14vstinnersetrecipients: + vstinner
2020-06-22 08:38:14vstinnersetmessageid: <1592815094.33.0.264745776024.issue41073@roundup.psfhosted.org>
2020-06-22 08:38:14vstinnerlinkissue41073 messages
2020-06-22 08:38:14vstinnercreate