From f16433a73138f279642e581074135694ddcfe965 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 5 Feb 2020 12:18:28 +0100 Subject: 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. --- Include/cpython/object.h | 10 ---------- Objects/object.c | 2 -- 2 files changed, 12 deletions(-) diff --git a/Include/cpython/object.h b/Include/cpython/object.h index 5fcad55..70f189c 100644 --- a/Include/cpython/object.h +++ b/Include/cpython/object.h @@ -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`. diff --git a/Objects/object.c b/Objects/object.c index e6bfad4..1884819 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -2162,8 +2162,6 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg, } -#undef _Py_Dealloc - void _Py_Dealloc(PyObject *op) { -- cgit v0.12