-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-C-APItype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
Description
Throughout the codebase, instances of mutable heap types must always implement the GC protocol to traverse their type. This leads to the following being repeated a lot:
static int
object_visit(PyObject *op, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(op));
return 0;
}
To reduce code duplication, I think it would be beneficial to have a common helper for this case. I'm going to call this _PyObject_VisitType
for now.
cc @picnixz
Linked PRs
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-C-APItype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)