]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-119085: Move comment in Python/gc.c to correct place.
authorAbhinav Upadhyay <er.abhinav.upadhyay@gmail.com>
Thu, 7 Aug 2025 20:31:11 +0000 (02:01 +0530)
committerGitHub <noreply@github.com>
Thu, 7 Aug 2025 20:31:11 +0000 (20:31 +0000)
In GH-116206, the comment about moving reachable objects to next generation
got moved from its original place to a place where there is no code below
it. Put the comment back to where the actual movement of reachable objects
happens.

Python/gc.c

index 2e697faac032b5972d8714539ebb9d504f150aba..807bd5b65b23323cd263af3c13467414382993c0 100644 (file)
@@ -1710,12 +1710,13 @@ gc_collect_region(PyThreadState *tstate,
     deduce_unreachable(from, &unreachable);
     validate_consistent_old_space(from);
     untrack_tuples(from);
+
+  /* Move reachable objects to next generation. */
     validate_consistent_old_space(to);
     if (from != to) {
         gc_list_merge(from, to);
     }
     validate_consistent_old_space(to);
-    /* Move reachable objects to next generation. */
 
     /* All objects in unreachable are trash, but objects reachable from
      * legacy finalizers (e.g. tp_del) can't safely be deleted.