mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #22869: Split pythonrun into two modules
- interpreter startup and shutdown code moved to a new pylifecycle.c module - Py_OptimizeFlag moved into the new module with the other global flags
This commit is contained in:
parent
66fb349d6c
commit
d600951748
16 changed files with 1701 additions and 1587 deletions
|
@ -33,6 +33,22 @@ _Py_GetRefTotal(void)
|
|||
total -= o->ob_refcnt;
|
||||
return total;
|
||||
}
|
||||
|
||||
void
|
||||
_PyDebug_PrintTotalRefs(void) {
|
||||
PyObject *xoptions, *value;
|
||||
_Py_IDENTIFIER(showrefcount);
|
||||
|
||||
xoptions = PySys_GetXOptions();
|
||||
if (xoptions == NULL)
|
||||
return;
|
||||
value = _PyDict_GetItemId(xoptions, &PyId_showrefcount);
|
||||
if (value == Py_True)
|
||||
fprintf(stderr,
|
||||
"[%" PY_FORMAT_SIZE_T "d refs, "
|
||||
"%" PY_FORMAT_SIZE_T "d blocks]\n",
|
||||
_Py_GetRefTotal(), _Py_GetAllocatedBlocks());
|
||||
}
|
||||
#endif /* Py_REF_DEBUG */
|
||||
|
||||
/* Object allocation routines used by NEWOBJ and NEWVAROBJ macros.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue