Skip to content

Commit bc2e110

Browse files
closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800)
(cherry picked from commit 745dc65) Co-authored-by: Eddie Elizondo <[email protected]>
1 parent c59bc98 commit bc2e110

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ Tal Einat
425425
Eric Eisner
426426
Andrew Eland
427427
Julien Élie
428+
Eduardo Elizondo
428429
Lance Ellinghaus
429430
Daniel Ellis
430431
Phil Elson
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the python debug build when using COUNT_ALLOCS.

Objects/listobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void
8686
show_alloc(void)
8787
{
8888
PyInterpreterState *interp = PyThreadState_GET()->interp;
89-
if (!inter->core_config.show_alloc_count) {
89+
if (!interp->core_config.show_alloc_count) {
9090
return;
9191
}
9292

Objects/object.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,11 @@ void
9797
dump_counts(FILE* f)
9898
{
9999
PyInterpreterState *interp = PyThreadState_GET()->interp;
100-
if (!inter->core_config.show_alloc_count) {
100+
if (!interp->core_config.show_alloc_count) {
101101
return;
102102
}
103103

104+
PyTypeObject *tp;
104105
for (tp = type_list; tp; tp = tp->tp_next)
105106
fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, "
106107
"freed: %" PY_FORMAT_SIZE_T "d, "

Objects/tupleobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static void
4545
show_track(void)
4646
{
4747
PyInterpreterState *interp = PyThreadState_GET()->interp;
48-
if (!inter->core_config.show_alloc_count) {
48+
if (!interp->core_config.show_alloc_count) {
4949
return;
5050
}
5151

0 commit comments

Comments
 (0)