mirror of
https://github.com/python/cpython.git
synced 2025-10-01 04:42:10 +00:00
closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800)
(cherry picked from commit 745dc65b17
)
Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
This commit is contained in:
parent
c59bc98fb2
commit
bc2e110469
5 changed files with 6 additions and 3 deletions
|
@ -425,6 +425,7 @@ Tal Einat
|
||||||
Eric Eisner
|
Eric Eisner
|
||||||
Andrew Eland
|
Andrew Eland
|
||||||
Julien Élie
|
Julien Élie
|
||||||
|
Eduardo Elizondo
|
||||||
Lance Ellinghaus
|
Lance Ellinghaus
|
||||||
Daniel Ellis
|
Daniel Ellis
|
||||||
Phil Elson
|
Phil Elson
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Fix the python debug build when using COUNT_ALLOCS.
|
|
@ -86,7 +86,7 @@ static void
|
||||||
show_alloc(void)
|
show_alloc(void)
|
||||||
{
|
{
|
||||||
PyInterpreterState *interp = PyThreadState_GET()->interp;
|
PyInterpreterState *interp = PyThreadState_GET()->interp;
|
||||||
if (!inter->core_config.show_alloc_count) {
|
if (!interp->core_config.show_alloc_count) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,10 +97,11 @@ void
|
||||||
dump_counts(FILE* f)
|
dump_counts(FILE* f)
|
||||||
{
|
{
|
||||||
PyInterpreterState *interp = PyThreadState_GET()->interp;
|
PyInterpreterState *interp = PyThreadState_GET()->interp;
|
||||||
if (!inter->core_config.show_alloc_count) {
|
if (!interp->core_config.show_alloc_count) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PyTypeObject *tp;
|
||||||
for (tp = type_list; tp; tp = tp->tp_next)
|
for (tp = type_list; tp; tp = tp->tp_next)
|
||||||
fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, "
|
fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, "
|
||||||
"freed: %" PY_FORMAT_SIZE_T "d, "
|
"freed: %" PY_FORMAT_SIZE_T "d, "
|
||||||
|
|
|
@ -45,7 +45,7 @@ static void
|
||||||
show_track(void)
|
show_track(void)
|
||||||
{
|
{
|
||||||
PyInterpreterState *interp = PyThreadState_GET()->interp;
|
PyInterpreterState *interp = PyThreadState_GET()->interp;
|
||||||
if (!inter->core_config.show_alloc_count) {
|
if (!interp->core_config.show_alloc_count) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue