https://github.com/python/cpython/commit/7bb41aef4b7b8f3c3f07c11b801c5b7f8afaac7f
commit: 7bb41aef4b7b8f3c3f07c11b801c5b7f8afaac7f
branch: main
author: Donghee Na <[email protected]>
committer: corona10 <[email protected]>
date: 2025-03-26T09:45:29+09:00
summary:
gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen (gh-131744)
files:
A Misc/NEWS.d/next/C_API/2025-03-26-06-56-40.gh-issue-131740.9PdxxQ.rst
M Python/gc.c
diff --git
a/Misc/NEWS.d/next/C_API/2025-03-26-06-56-40.gh-issue-131740.9PdxxQ.rst
b/Misc/NEWS.d/next/C_API/2025-03-26-06-56-40.gh-issue-131740.9PdxxQ.rst
new file mode 100644
index 00000000000000..585f07aaddd8c8
--- /dev/null
+++ b/Misc/NEWS.d/next/C_API/2025-03-26-06-56-40.gh-issue-131740.9PdxxQ.rst
@@ -0,0 +1 @@
+Update PyUnstable_GC_VisitObjects to traverse perm gen.
diff --git a/Python/gc.c b/Python/gc.c
index a2ec0e567b5e39..8d7f6ac2f3ab53 100644
--- a/Python/gc.c
+++ b/Python/gc.c
@@ -2415,7 +2415,10 @@ PyUnstable_GC_VisitObjects(gcvisitobjects_t callback,
void *arg)
if (visit_generation(callback, arg, &gcstate->old[0])) {
goto done;
}
- visit_generation(callback, arg, &gcstate->old[1]);
+ if (visit_generation(callback, arg, &gcstate->old[1])) {
+ goto done;
+ }
+ visit_generation(callback, arg, &gcstate->permanent_generation);
done:
gcstate->enabled = origenstate;
}
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]