mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
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:
parent
447d095976
commit
c6e55068ca
20 changed files with 108 additions and 339 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue