@@ -504,7 +504,7 @@ performing garbage collection by at least half.
504504
505505We use the same technique of forming a transitive closure as the incremental
506506collector does to find reachable objects, seeding the list with some global
507- objects and the current frame of each stack .
507+ objects and the currently executing frames .
508508
509509This phase moves objects to the ` visited ` space, as follows:
510510
@@ -515,10 +515,13 @@ set of reachable objects.
515515 1 . Pop an object from the set and move it to the ` visited ` space
516516 2 . For each object directly reachable from that object:
517517 * If it is not already in ` visited ` space and it is a GC object,
518- then add it to the working set
518+ add it to the working set
519519
520- Before each increment of collection is performed, the working set is updated to
521- include any new stack frames that have been created since the last increment.
520+
521+ Before each increment of collection is performed, the stacks are scanned
522+ to check for any new stack frames that have been created since the last
523+ increment. All objects directly referred to from those stack frames are
524+ added to the working set.
522525Then the above algorithm is repeated, starting from step 2.
523526
524527
@@ -570,8 +573,8 @@ of `PyGC_Head` discussed in the `Memory layout and object structure`_ section:
570573 currently in. Instead, when that's needed, ad hoc tricks (like the
571574 ` NEXT_MASK_UNREACHABLE ` flag) are employed.
572575
573- Optimization: delayed untracking containers
574- ===========================================
576+ Optimization: delayed untracking of containers
577+ ==============================================
575578
576579Certain types of containers cannot participate in a reference cycle, and so do
577580not need to be tracked by the garbage collector. Untracking these objects
0 commit comments