mirror of
https://github.com/python/cpython.git
synced 2025-10-25 18:54:53 +00:00
gh-138342: Use a common utility for visiting an object's type (GH-138343)
Add `_PyObject_VisitType` in place of `tp_traverse` functions that only visit the object's type.
This commit is contained in:
parent
0d02e4d7d3
commit
4f6ecd10c2
24 changed files with 41 additions and 203 deletions
|
|
@ -714,14 +714,6 @@ ins1(arrayobject *self, Py_ssize_t where, PyObject *v)
|
|||
}
|
||||
|
||||
/* Methods */
|
||||
|
||||
static int
|
||||
array_tp_traverse(PyObject *op, visitproc visit, void *arg)
|
||||
{
|
||||
Py_VISIT(Py_TYPE(op));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
array_dealloc(PyObject *op)
|
||||
{
|
||||
|
|
@ -2968,7 +2960,7 @@ static PyType_Slot array_slots[] = {
|
|||
{Py_tp_getset, array_getsets},
|
||||
{Py_tp_alloc, PyType_GenericAlloc},
|
||||
{Py_tp_new, array_new},
|
||||
{Py_tp_traverse, array_tp_traverse},
|
||||
{Py_tp_traverse, _PyObject_VisitType},
|
||||
|
||||
/* as sequence */
|
||||
{Py_sq_length, array_length},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue