Lines Matching full:generation
50 // update_refs() set this bit for all objects in current generation.
193 to gc_refs, for each object in the generation being collected.
195 times an object is referenced directly from outside the generation
199 Objects in generation being collected are marked PREV_MASK_COLLECTING in
218 indirectly) from outside the generation into an "unreachable" set and
455 * generation being collected, which can be recognized in visit_decref()
495 // Ignore objects in other generation. in visit_reachable()
748 * weakrefs with callbacks may be moved into the `old` generation. Objects
832 * outside the current generation, CT may be reachable from the in handle_weakrefs()
843 * root to this generation, and therefore its callback did too. So in handle_weakrefs()
1030 * All free lists are cleared during the collection of the highest generation.
1059 "gc: objects in each generation:%s\n" in show_stats_each_generations()
1060 "gc: objects in permanent generation: %zd\n", in show_stats_each_generations()
1112 * generation in the same order. If B points to A, and C to B, and C is in deduce_unreachable()
1171 // Move the resurrected objects to the old generation for future collection. in handle_resurrected_objects()
1178 gc_collect_main(PyThreadState *tstate, int generation, in gc_collect_main() argument
1185 PyGC_Head *young; /* the generation we are examining */ in gc_collect_main()
1186 PyGC_Head *old; /* next older generation */ in gc_collect_main()
1199 PySys_WriteStderr("gc: collecting generation %d...\n", generation); in gc_collect_main()
1205 PyDTrace_GC_START(generation); in gc_collect_main()
1208 if (generation+1 < NUM_GENERATIONS) in gc_collect_main()
1209 gcstate->generations[generation+1].count += 1; in gc_collect_main()
1210 for (i = 0; i <= generation; i++) in gc_collect_main()
1214 for (i = 0; i < generation; i++) { in gc_collect_main()
1215 gc_list_merge(GEN_HEAD(gcstate, i), GEN_HEAD(gcstate, generation)); in gc_collect_main()
1219 young = GEN_HEAD(gcstate, generation); in gc_collect_main()
1220 if (generation < NUM_GENERATIONS-1) in gc_collect_main()
1221 old = GEN_HEAD(gcstate, generation+1); in gc_collect_main()
1229 /* Move reachable objects to next generation. */ in gc_collect_main()
1231 if (generation == NUM_GENERATIONS - 2) { in gc_collect_main()
1311 * generation */ in gc_collect_main()
1312 if (generation == NUM_GENERATIONS-1) { in gc_collect_main()
1333 struct gc_generation_stats *stats = &gcstate->generation_stats[generation]; in gc_collect_main()
1351 int generation, Py_ssize_t collected, in invoke_gc_callback() argument
1367 "generation", generation, in invoke_gc_callback()
1391 /* Perform garbage collection of a generation and invoke
1395 gc_collect_with_callback(PyThreadState *tstate, int generation) in gc_collect_with_callback() argument
1399 invoke_gc_callback(tstate, "start", generation, 0, 0); in gc_collect_with_callback()
1400 result = gc_collect_main(tstate, generation, &collected, &uncollectable, 0); in gc_collect_with_callback()
1401 invoke_gc_callback(tstate, "stop", generation, collected, uncollectable); in gc_collect_with_callback()
1410 /* Find the oldest generation (highest numbered) where the count in gc_collect_generations()
1411 * exceeds the threshold. Objects in the that generation and in gc_collect_generations()
1508 generation: int(c_default="NUM_GENERATIONS - 1") = 2
1513 may be an integer specifying which generation to collect. A ValueError
1514 is raised if the generation number is invalid.
1520 gc_collect_impl(PyObject *module, int generation) in gc_collect_impl() argument
1525 if (generation < 0 || generation >= NUM_GENERATIONS) { in gc_collect_impl()
1526 _PyErr_SetString(tstate, PyExc_ValueError, "invalid generation"); in gc_collect_impl()
1538 n = gc_collect_with_callback(tstate, generation); in gc_collect_impl()
1738 generation: Py_ssize_t(accept={int, NoneType}, c_default="-1") = None
1739 Generation to extract the objects from.
1743 If generation is not None, return only the objects tracked by the collector
1744 that are in that generation.
1748 gc_get_objects_impl(PyObject *module, Py_ssize_t generation) in gc_get_objects_impl() argument
1756 if (PySys_Audit("gc.get_objects", "n", generation) < 0) { in gc_get_objects_impl()
1765 /* If generation is passed, we extract only that generation */ in gc_get_objects_impl()
1766 if (generation != -1) { in gc_get_objects_impl()
1767 if (generation >= NUM_GENERATIONS) { in gc_get_objects_impl()
1769 "generation parameter must be less than the number of " in gc_get_objects_impl()
1775 if (generation < 0) { in gc_get_objects_impl()
1777 "generation parameter cannot be negative"); in gc_get_objects_impl()
1781 if (append_objects(result, GEN_HEAD(gcstate, generation))) { in gc_get_objects_impl()
1788 /* If generation is not passed or None, get all objects from all generations */ in gc_get_objects_impl()
1804 Return a list of dictionaries containing per-generation statistics.
1918 Unfreeze all objects in the permanent generation.
1920 Put all objects in the permanent generation back into oldest generation.
1936 Return the number of objects in the permanent generation.
1956 "get_stats() -- Return list of dictionaries containing per-generation stats.\n"
1967 "unfreeze() -- Unfreeze all objects in the permanent generation.\n"
1968 "get_freeze_count() -- Return the number of objects in the permanent generation.\n");