Lines Matching refs:_PyRuntime
57 #define GEN_HEAD(n) (&_PyRuntime.gc.generations[n].head)
657 if (_PyRuntime.gc.garbage == NULL) { in handle_legacy_finalizers()
658 _PyRuntime.gc.garbage = PyList_New(0); in handle_legacy_finalizers()
659 if (_PyRuntime.gc.garbage == NULL) in handle_legacy_finalizers()
665 if ((_PyRuntime.gc.debug & DEBUG_SAVEALL) || has_legacy_finalizer(op)) { in handle_legacy_finalizers()
666 if (PyList_Append(_PyRuntime.gc.garbage, op) < 0) in handle_legacy_finalizers()
755 if (_PyRuntime.gc.debug & DEBUG_SAVEALL) { in delete_garbage()
756 PyList_Append(_PyRuntime.gc.garbage, op); in delete_garbage()
810 struct gc_generation_stats *stats = &_PyRuntime.gc.generation_stats[generation]; in collect()
812 if (_PyRuntime.gc.debug & DEBUG_STATS) { in collect()
820 gc_list_size(&_PyRuntime.gc.permanent_generation.head)); in collect()
831 _PyRuntime.gc.generations[generation+1].count += 1; in collect()
833 _PyRuntime.gc.generations[i].count = 0; in collect()
867 _PyRuntime.gc.long_lived_pending += gc_list_size(young); in collect()
875 _PyRuntime.gc.long_lived_pending = 0; in collect()
876 _PyRuntime.gc.long_lived_total = gc_list_size(young); in collect()
896 if (_PyRuntime.gc.debug & DEBUG_COLLECTABLE) { in collect()
925 if (_PyRuntime.gc.debug & DEBUG_UNCOLLECTABLE) in collect()
928 if (_PyRuntime.gc.debug & DEBUG_STATS) { in collect()
991 if (_PyRuntime.gc.callbacks == NULL) in invoke_gc_callback()
994 assert(_PyRuntime.gc.callbacks != NULL && PyList_CheckExact(_PyRuntime.gc.callbacks)); in invoke_gc_callback()
995 if (PyList_GET_SIZE(_PyRuntime.gc.callbacks) != 0) { in invoke_gc_callback()
1005 for (i=0; i<PyList_GET_SIZE(_PyRuntime.gc.callbacks); i++) { in invoke_gc_callback()
1006 PyObject *r, *cb = PyList_GET_ITEM(_PyRuntime.gc.callbacks, i); in invoke_gc_callback()
1043 if (_PyRuntime.gc.generations[i].count > _PyRuntime.gc.generations[i].threshold) { in collect_generations()
1049 && _PyRuntime.gc.long_lived_pending < _PyRuntime.gc.long_lived_total / 4) in collect_generations()
1070 _PyRuntime.gc.enabled = 1; in gc_enable_impl()
1084 _PyRuntime.gc.enabled = 0; in gc_disable_impl()
1098 return _PyRuntime.gc.enabled; in gc_isenabled_impl()
1126 if (_PyRuntime.gc.collecting) in gc_collect_impl()
1129 _PyRuntime.gc.collecting = 1; in gc_collect_impl()
1131 _PyRuntime.gc.collecting = 0; in gc_collect_impl()
1159 _PyRuntime.gc.debug = flags; in gc_set_debug_impl()
1174 return _PyRuntime.gc.debug; in gc_get_debug_impl()
1188 &_PyRuntime.gc.generations[0].threshold, in gc_set_thresh()
1189 &_PyRuntime.gc.generations[1].threshold, in gc_set_thresh()
1190 &_PyRuntime.gc.generations[2].threshold)) in gc_set_thresh()
1194 _PyRuntime.gc.generations[i].threshold = _PyRuntime.gc.generations[2].threshold; in gc_set_thresh()
1211 _PyRuntime.gc.generations[0].threshold, in gc_get_threshold_impl()
1212 _PyRuntime.gc.generations[1].threshold, in gc_get_threshold_impl()
1213 _PyRuntime.gc.generations[2].threshold); in gc_get_threshold_impl()
1227 _PyRuntime.gc.generations[0].count, in gc_get_count_impl()
1228 _PyRuntime.gc.generations[1].count, in gc_get_count_impl()
1229 _PyRuntime.gc.generations[2].count); in gc_get_count_impl()
1360 stats[i] = _PyRuntime.gc.generation_stats[i]; in gc_get_stats_impl()
1431 gc_list_merge(GEN_HEAD(i), &_PyRuntime.gc.permanent_generation.head); in gc_freeze_impl()
1432 _PyRuntime.gc.generations[i].count = 0; in gc_freeze_impl()
1449 gc_list_merge(&_PyRuntime.gc.permanent_generation.head, GEN_HEAD(NUM_GENERATIONS-1)); in gc_unfreeze_impl()
1463 return gc_list_size(&_PyRuntime.gc.permanent_generation.head); in gc_get_freeze_count_impl()
1533 if (_PyRuntime.gc.garbage == NULL) { in PyInit_gc()
1534 _PyRuntime.gc.garbage = PyList_New(0); in PyInit_gc()
1535 if (_PyRuntime.gc.garbage == NULL) in PyInit_gc()
1538 Py_INCREF(_PyRuntime.gc.garbage); in PyInit_gc()
1539 if (PyModule_AddObject(m, "garbage", _PyRuntime.gc.garbage) < 0) in PyInit_gc()
1542 if (_PyRuntime.gc.callbacks == NULL) { in PyInit_gc()
1543 _PyRuntime.gc.callbacks = PyList_New(0); in PyInit_gc()
1544 if (_PyRuntime.gc.callbacks == NULL) in PyInit_gc()
1547 Py_INCREF(_PyRuntime.gc.callbacks); in PyInit_gc()
1548 if (PyModule_AddObject(m, "callbacks", _PyRuntime.gc.callbacks) < 0) in PyInit_gc()
1567 if (_PyRuntime.gc.collecting) in PyGC_Collect()
1571 _PyRuntime.gc.collecting = 1; in PyGC_Collect()
1575 _PyRuntime.gc.collecting = 0; in PyGC_Collect()
1584 if (!_PyRuntime.gc.enabled) in _PyGC_CollectIfEnabled()
1601 if (_PyRuntime.gc.collecting) in _PyGC_CollectNoFail()
1604 _PyRuntime.gc.collecting = 1; in _PyGC_CollectNoFail()
1606 _PyRuntime.gc.collecting = 0; in _PyGC_CollectNoFail()
1614 if (!(_PyRuntime.gc.debug & DEBUG_SAVEALL) in _PyGC_DumpShutdownStats()
1615 && _PyRuntime.gc.garbage != NULL && PyList_GET_SIZE(_PyRuntime.gc.garbage) > 0) { in _PyGC_DumpShutdownStats()
1617 if (_PyRuntime.gc.debug & DEBUG_UNCOLLECTABLE) in _PyGC_DumpShutdownStats()
1628 PyList_GET_SIZE(_PyRuntime.gc.garbage))) in _PyGC_DumpShutdownStats()
1630 if (_PyRuntime.gc.debug & DEBUG_UNCOLLECTABLE) { in _PyGC_DumpShutdownStats()
1632 repr = PyObject_Repr(_PyRuntime.gc.garbage); in _PyGC_DumpShutdownStats()
1634 PyErr_WriteUnraisable(_PyRuntime.gc.garbage); in _PyGC_DumpShutdownStats()
1650 Py_CLEAR(_PyRuntime.gc.callbacks); in _PyGC_Fini()
1701 _PyRuntime.gc.generations[0].count++; /* number of allocated GC objects */ in _PyObject_GC_Alloc()
1702 if (_PyRuntime.gc.generations[0].count > _PyRuntime.gc.generations[0].threshold && in _PyObject_GC_Alloc()
1703 _PyRuntime.gc.enabled && in _PyObject_GC_Alloc()
1704 _PyRuntime.gc.generations[0].threshold && in _PyObject_GC_Alloc()
1705 !_PyRuntime.gc.collecting && in _PyObject_GC_Alloc()
1707 _PyRuntime.gc.collecting = 1; in _PyObject_GC_Alloc()
1709 _PyRuntime.gc.collecting = 0; in _PyObject_GC_Alloc()
1775 if (_PyRuntime.gc.generations[0].count > 0) { in PyObject_GC_Del()
1776 _PyRuntime.gc.generations[0].count--; in PyObject_GC_Del()