mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
This commit is contained in:
parent
13ad3b7a82
commit
93c92f7d1d
21 changed files with 154 additions and 308 deletions
|
@ -29,23 +29,20 @@ _Py_GetRefTotal(void)
|
|||
return total;
|
||||
}
|
||||
|
||||
PyObject *
|
||||
_PyDebug_XOptionShowRefCount(void)
|
||||
{
|
||||
PyObject *xoptions = PySys_GetXOptions();
|
||||
if (xoptions == NULL)
|
||||
return NULL;
|
||||
|
||||
_Py_IDENTIFIER(showrefcount);
|
||||
return _PyDict_GetItemId(xoptions, &PyId_showrefcount);
|
||||
}
|
||||
|
||||
void
|
||||
_PyDebug_PrintTotalRefs(void) {
|
||||
fprintf(stderr,
|
||||
"[%" PY_FORMAT_SIZE_T "d refs, "
|
||||
"%" PY_FORMAT_SIZE_T "d blocks]\n",
|
||||
_Py_GetRefTotal(), _Py_GetAllocatedBlocks());
|
||||
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 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue