Skip to content

Commit a4a37fe

Browse files
committed
Merged revisions 68381 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68381 | martin.v.loewis | 2009-01-07 12:40:40 -0600 (Wed, 07 Jan 2009) | 2 lines Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. ........
1 parent c7d484d commit a4a37fe

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

Objects/bytesobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ _getbuffer(PyObject *obj, Py_buffer *view)
2626
}
2727

2828
#ifdef COUNT_ALLOCS
29-
int null_strings, one_strings;
29+
Py_ssize_t null_strings, one_strings;
3030
#endif
3131

3232
static PyBytesObject *characters[UCHAR_MAX + 1];

Objects/object.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,29 @@ static PyTypeObject *type_list;
8181
garbage itself. If unlist_types_without_objects
8282
is set, they will be removed from the type_list
8383
once the last object is deallocated. */
84-
int unlist_types_without_objects;
85-
extern int tuple_zero_allocs, fast_tuple_allocs;
86-
extern int quick_int_allocs, quick_neg_int_allocs;
87-
extern int null_strings, one_strings;
84+
static int unlist_types_without_objects;
85+
extern Py_ssize_t tuple_zero_allocs, fast_tuple_allocs;
86+
extern Py_ssize_t quick_int_allocs, quick_neg_int_allocs;
87+
extern Py_ssize_t null_strings, one_strings;
8888
void
8989
dump_counts(FILE* f)
9090
{
9191
PyTypeObject *tp;
9292

9393
for (tp = type_list; tp; tp = tp->tp_next)
94-
fprintf(f, "%s alloc'd: %d, freed: %d, max in use: %d\n",
94+
fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, "
95+
"freed: %" PY_FORMAT_SIZE_T "d, "
96+
"max in use: %" PY_FORMAT_SIZE_T "d\n",
9597
tp->tp_name, tp->tp_allocs, tp->tp_frees,
9698
tp->tp_maxalloc);
97-
fprintf(f, "fast tuple allocs: %d, empty: %d\n",
99+
fprintf(f, "fast tuple allocs: %" PY_FORMAT_SIZE_T "d, "
100+
"empty: %" PY_FORMAT_SIZE_T "d\n",
98101
fast_tuple_allocs, tuple_zero_allocs);
99-
fprintf(f, "fast int allocs: pos: %d, neg: %d\n",
102+
fprintf(f, "fast int allocs: pos: %" PY_FORMAT_SIZE_T "d, "
103+
"neg: %" PY_FORMAT_SIZE_T "d\n",
100104
quick_int_allocs, quick_neg_int_allocs);
101-
fprintf(f, "null strings: %d, 1-strings: %d\n",
105+
fprintf(f, "null strings: %" PY_FORMAT_SIZE_T "d, "
106+
"1-strings: %" PY_FORMAT_SIZE_T "d\n",
102107
null_strings, one_strings);
103108
}
104109

Objects/tupleobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ static PyTupleObject *free_list[PyTuple_MAXSAVESIZE];
1919
static int numfree[PyTuple_MAXSAVESIZE];
2020
#endif
2121
#ifdef COUNT_ALLOCS
22-
int fast_tuple_allocs;
23-
int tuple_zero_allocs;
22+
Py_ssize_t fast_tuple_allocs;
23+
Py_ssize_t tuple_zero_allocs;
2424
#endif
2525

2626
PyObject *

0 commit comments

Comments
 (0)