mirror of
https://github.com/python/cpython
synced 2024-09-05 00:05:39 +00:00
bpo-42972: Fully implement GC protocol for xxlimited (GH-26451)
This commit is contained in:
parent
8ab5b7eeca
commit
4b20f2574d
|
@ -106,6 +106,13 @@ Xxo_traverse(XxoObject *self, visitproc visit, void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
Xxo_clear(XxoObject *self)
|
||||
{
|
||||
Py_CLEAR(self->x_attr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
Xxo_finalize(XxoObject *self)
|
||||
{
|
||||
|
@ -214,6 +221,7 @@ PyDoc_STRVAR(Xxo_doc,
|
|||
static PyType_Slot Xxo_Type_slots[] = {
|
||||
{Py_tp_doc, (char *)Xxo_doc},
|
||||
{Py_tp_traverse, Xxo_traverse},
|
||||
{Py_tp_clear, Xxo_clear},
|
||||
{Py_tp_finalize, Xxo_finalize},
|
||||
{Py_tp_dealloc, Xxo_dealloc},
|
||||
{Py_tp_getattro, Xxo_getattro},
|
||||
|
|
|
@ -43,6 +43,13 @@ Xxo_traverse(XxoObject *self, visitproc visit, void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
Xxo_clear(XxoObject *self)
|
||||
{
|
||||
Py_CLEAR(self->x_attr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
Xxo_finalize(XxoObject *self)
|
||||
{
|
||||
|
@ -108,6 +115,7 @@ Xxo_setattr(XxoObject *self, const char *name, PyObject *v)
|
|||
static PyType_Slot Xxo_Type_slots[] = {
|
||||
{Py_tp_doc, "The Xxo type"},
|
||||
{Py_tp_traverse, Xxo_traverse},
|
||||
{Py_tp_clear, Xxo_clear},
|
||||
{Py_tp_finalize, Xxo_finalize},
|
||||
{Py_tp_getattro, Xxo_getattro},
|
||||
{Py_tp_setattr, Xxo_setattr},
|
||||
|
|
Loading…
Reference in a new issue