mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
bpo-32030: Add more options to _PyCoreConfig (#4485)
Py_Main() now handles two more -X options: * -X showrefcount: new _PyCoreConfig.show_ref_count field * -X showalloccount: new _PyCoreConfig.show_alloc_count field
This commit is contained in:
parent
09f3a8a124
commit
25420fe290
9 changed files with 41 additions and 57 deletions
|
@ -91,6 +91,9 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename_str, PyCompilerFlags *
|
|||
int ret, err;
|
||||
PyCompilerFlags local_flags;
|
||||
int nomem_count = 0;
|
||||
#ifdef Py_REF_DEBUG
|
||||
int show_ref_count = PyThreadState_GET()->interp->core_config.show_ref_count;
|
||||
#endif
|
||||
|
||||
filename = PyUnicode_DecodeFSDefault(filename_str);
|
||||
if (filename == NULL) {
|
||||
|
@ -134,8 +137,9 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename_str, PyCompilerFlags *
|
|||
nomem_count = 0;
|
||||
}
|
||||
#ifdef Py_REF_DEBUG
|
||||
if (_PyDebug_XOptionShowRefCount() == Py_True)
|
||||
if (show_ref_count) {
|
||||
_PyDebug_PrintTotalRefs();
|
||||
}
|
||||
#endif
|
||||
} while (ret != E_EOF);
|
||||
Py_DECREF(filename);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue