8000 bpo-44116: Add GC support to _csv heap types by erlend-aasland · Pull Request #26074 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-44116: Add GC support to _csv heap types #26074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert _csv.Error changes
  • Loading branch information
Erlend E. Aasland committed May 12, 2021
commit b8772d6d405c4160d8ce19f58074c92e1d4ab7c0
20 changes: 1 addition & 19 deletions Modules/_csv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1530,31 +1530,13 @@ csv_field_size_limit(PyObject *module, PyObject *args)
return PyLong_FromLong(old_limit);
}

static void
error_dealloc(PyObject *self)
{
PyObject_GC_UnTrack(self);
PyTypeObject *tp = Py_TYPE(self);
tp->tp_free((PyObject *)self);
Py_DECREF(tp);
}

static int
error_traverse(PyObject *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
return 0;
}

static PyType_Slot error_slots[] = {
{Py_tp_traverse, error_traverse},
{Py_tp_dealloc, error_dealloc},
{0, NULL},
};

PyType_Spec error_spec = {
.name = "_csv.Error",
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
.slots = error_slots,
};

Expand Down
0