mirror of
https://github.com/python/cpython.git
synced 2025-11-03 15:11:34 +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
|
|
@ -1008,17 +1008,10 @@ py_blake2_dealloc(PyObject *self)
|
|||
Py_DECREF(type);
|
||||
}
|
||||
|
||||
static int
|
||||
py_blake2_traverse(PyObject *self, visitproc visit, void *arg)
|
||||
{
|
||||
Py_VISIT(Py_TYPE(self));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyType_Slot blake2b_type_slots[] = {
|
||||
{Py_tp_clear, py_blake2_clear},
|
||||
{Py_tp_dealloc, py_blake2_dealloc},
|
||||
{Py_tp_traverse, py_blake2_traverse},
|
||||
{Py_tp_traverse, _PyObject_VisitType},
|
||||
{Py_tp_doc, (char *)py_blake2b_new__doc__},
|
||||
{Py_tp_methods, py_blake2b_methods},
|
||||
{Py_tp_getset, py_blake2b_getsetters},
|
||||
|
|
@ -1029,7 +1022,7 @@ static PyType_Slot blake2b_type_slots[] = {
|
|||
static PyType_Slot blake2s_type_slots[] = {
|
||||
{Py_tp_clear, py_blake2_clear},
|
||||
{Py_tp_dealloc, py_blake2_dealloc},
|
||||
{Py_tp_traverse, py_blake2_traverse},
|
||||
{Py_tp_traverse, _PyObject_VisitType},
|
||||
{Py_tp_doc, (char *)py_blake2s_new__doc__},
|
||||
{Py_tp_methods, py_blake2b_methods},
|
||||
{Py_tp_getset, py_blake2b_getsetters},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue