]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39543: Remove unused _Py_Dealloc() macro (GH-18361)
authorVictor Stinner <vstinner@python.org>
Wed, 5 Feb 2020 11:18:28 +0000 (12:18 +0100)
committerGitHub <noreply@github.com>
Wed, 5 Feb 2020 11:18:28 +0000 (12:18 +0100)
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
Objects/object.c

index 5fcad55c5c96011a22e2dbd778afeb2744d0093c..70f189c85698f257f29792692c8b18a563d4f8af 100644 (file)
@@ -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`.
index e6bfad4e7295e2b4e7c946428bb9ba9bb3346fa0..1884819b982c4a69ed4d9e3918a283860a91d20b 100644 (file)
@@ -2162,8 +2162,6 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg,
 }
 
 
-#undef _Py_Dealloc
-
 void
 _Py_Dealloc(PyObject *op)
 {