Use Py_VISIT in all tp_traverse methods, instead of traversing manually or

using a custom, nearly-identical macro. This probably changes how some of
these functions are compiled, which may result in fractionally slower (or
faster) execution. Considering the nature of traversal, visiting much of the
address space in unpredictable patterns, I'd argue the code readability and
maintainability is well worth it ;P
This commit is contained in:
Thomas Wouters 2006-04-15 21:47:09 +00:00
parent 447d095976
commit c6e55068ca
20 changed files with 108 additions and 339 deletions

View file

@ -204,8 +204,7 @@ module_repr(PyModuleObject *m)
static int
module_traverse(PyModuleObject *m, visitproc visit, void *arg)
{
if (m->md_dict != NULL)
return visit(m->md_dict, arg);
Py_VISIT(m->md_dict);
return 0;
}