Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f16433a

Browse files
authored
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.
1 parent 787b6d5 commit f16433a

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

Include/cpython/object.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -327,16 +327,6 @@ _PyObject_GenericSetAttrWithDict(PyObject *, PyObject *,
327327

328328
#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
329329

330-
static inline void _Py_Dealloc_inline(PyObject *op)
331-
{
332-
destructor dealloc = Py_TYPE(op)->tp_dealloc;
333-
#ifdef Py_TRACE_REFS
334-
_Py_ForgetReference(op);
335-
#endif
336-
(*dealloc)(op);
337-
}
338-
#define _Py_Dealloc(op) _Py_Dealloc_inline(op)
339-
340330
PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
341331

342332
/* Safely decref `op` and set `op` to `op2`.

Objects/object.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,8 +2162,6 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg,
21622162
}
21632163

21642164

2165-
#undef _Py_Dealloc
2166-
21672165
void
21682166
_Py_Dealloc(PyObject *op)
21692167
{

0 commit comments

Comments
 (0)