| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| /* Monotonic guard for tracked objects that may outlive their interpreter. | ||
| * Kept outside _PyRuntime so reinitialization cannot clear it. | ||
| */ | ||
| static int may_have_foreign_gc_objects; |
There was a problem hiding this comment.
This condition is only used by GC. A simular guard I used in an earlier PR lived in gc.c and was updated from _PyGC_InitState, which avoided another accessor and declaration.
Is there a lifecycle case that needs this set before GC state initialization? Otherwise we could keep it local to GC, while still remembering previous interpreters after teardown and runtime restart.
Sorry, something went wrong.
| 'bar()\n') | ||
| # Full GIL collections may skip update_refs(). Stop at a visible phase | ||
| # after the collector marks collection active. | ||
| if support.Py_GIL_DISABLED: |
There was a problem hiding this comment.
Why not use gc_collect_main regardless of the GIL? The collectors have it and the GDB helper already recognizes it. There's an example in an earlier PR, where I made the same breakpoint change. That would remove this branch.
Sorry, something went wrong.
Count the stable unreachable set while preparing callbacks and retain a conservative cleanup flag. Reuse the count only when late weakref clearing has no work, and force fresh cleanup and counting after resurrection analysis. Add a regression for a callback-free weakref observed when clearing a young cycle releases an older finalizer.
| Back | FazBrowse Home | New Git URL |
With this optimization the GIL collector initializes temporary reference counts while subtracting references within the collection. Initializing each count on first encounter combines two walks over the objects into one.
The combined pass is limited to the initial reachability analysis of full collections. It requires an empty permanent generation and is disabled after any subinterpreter reservation or runtime reinitialization. These restrictions ensure every tracked mortal referent is part of the collection. Young collections and resurrection checks keep the existing passes.
Performance
Before is #159590 (0daa2029); after is this PR at 9fe33d48. Both builds use -falign-functions=64.
btree_gc_only times full collection of a 200,000-node B-tree.
Benchmarks: python/pyperformance#496