-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the pyc.visit() cache local to a visitor.
A global cache creates a memory leak in a persistent worker; in its current form it's also incorrect, since object ids can be recycled. Visitors are a more appropriate place to store the cache, as they're not reused across calls to pyc.visit(). Note: a WeakKeyDictionary would have been more ergonomic than a dict keyed by object id, but it would require the keys to be hashable, which they currently aren't. It would also create more work for the GC, which isn't necessarily free. PiperOrigin-RevId: 652460329
- Loading branch information
1 parent
029c393
commit 750d34d
Showing
4 changed files
with
29 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters