8000 gh-103092: Port some `_ctypes` data types to heap types by neonene · Pull Request #113630 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-103092: Port some _ctypes data types to heap types #113630

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

Closed
wants to merge 20 commits into from
Closed
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
cleanup
  • Loading branch information
neonene authored Jan 2, 2024
commit 525de82f7b76f2299b2e2880b2f411440f2dde82
10 changes: 2 additions & 8 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -5002,17 +5002,11 @@ Simple_traverse(CDataObject *self, visitproc visit, void *arg)
return PyCData_traverse(self, visit, arg);
}

static int
Simple_clear(CDataObject *self)
{
return PyCData_clear(self);
}

static void
Simple_dealloc(PyObject *self) {
PyTypeObject *tp = Py_TYPE(self);
PyObject_GC_UnTrack(self);
Simple_clear((CDataObject *)self);
PyCData_clear((CDataObject *)self);
tp->tp_free(self);
Py_DECREF(tp);
}
Expand All @@ -5025,7 +5019,7 @@ static PyType_Slot simple_slots[] = {
{Py_tp_new, GenericPyCData_new},
{Py_tp_init, Simple_init},
{Py_tp_traverse, Simple_traverse},
{Py_tp_clear, Simple_clear},
{Py_tp_clear, PyCData_clear},
{Py_tp_dealloc, Simple_dealloc},
{Py_nb_bool, Simple_bool},
{0, NULL},
Expand Down
0