Repository navigation
Conversation
Documentation build overview
17 files changed ·
|
nascheme
left a comment
There was a problem hiding this comment.
LTGM aside from the "unreachable" wording.
|
|
||
| If an error occurs during traversal, ignore it and return 0. | ||
| If ``tp_traverse`` fails to visit some strong references, objects | ||
| may become unreachable and waste memory, but correctness won't be affected. |
There was a problem hiding this comment.
I would say something like "garbage reference cycles will not be broken and the program may waste memory". If you want to use to word "unreachable", I would say something like "the GC will not reliability determine which objects are unreachable and are only alive due to circular references"
There was a problem hiding this comment.
Or maybe more precisely "garbage reference cycles involving the skipped strong references will not be reliably broken". I think that's accurate. The GC will still be able to break up cyclic garbage involving the working tp_traverse methods (i.e. one failing tp_traverse doesn't prevent the cyclic GC from functioning entirely, which could be wrongly inferred). OTOH, maybe we want to be careful about promising too much. As the GC is now, it's true that other garbage reference cycles can be broken, even in the face of some tp_traverse methods not revealing all strong references. But maybe that's too strong of a promise.
There was a problem hiding this comment.
I think we can guarantee that. If one incorrect tp_traverse could gum up the entire garbage collector, we'd have a big problem.
Also, “involving” isn't a very precise term...
Uh oh!
There was an error while loading. Please reload this page.