bpo-39543: Remove unused _Py_Dealloc() macro (GH-18361)
The macro is defined after Py_DECREF() and so is no longer used by Py_DECREF(). Moving _Py_Dealloc() macro back from cpython/object.h to object.h would require to move a lot of definitions as well: PyTypeObject and many related types used by PyTypeObject. Keep _Py_Dealloc() as an opaque function call to avoid leaking implementation details in the limited C API (object.h): remove _Py_Dealloc() macro from cpython/object.h.
This commit is contained in:
parent
787b6d548c
commit
f16433a731
|
@ -327,16 +327,6 @@ _PyObject_GenericSetAttrWithDict(PyObject *, PyObject *,
|
|||
|
||||
#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
|
||||
|
||||
static inline void _Py_Dealloc_inline(PyObject *op)
|
||||
{
|
||||
destructor dealloc = Py_TYPE(op)->tp_dealloc;
|
||||
#ifdef Py_TRACE_REFS
|
||||
_Py_ForgetReference(op);
|
||||
#endif
|
||||
(*dealloc)(op);
|
||||
}
|
||||
#define _Py_Dealloc(op) _Py_Dealloc_inline(op)
|
||||
|
||||
PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
|
||||
|
||||
/* Safely decref `op` and set `op` to `op2`.
|
||||
|
|
|
@ -2162,8 +2162,6 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg,
|
|||
}
|
||||
|
||||
|
||||
#undef _Py_Dealloc
|
||||
|
||||
void
|
||||
_Py_Dealloc(PyObject *op)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue