Index: Objects/object.c
===================================================================
--- Objects/object.c (revision 68196)
+++ Objects/object.c (working copy)
@@ -81,25 +81,25 @@
garbage itself. If unlist_types_without_objects
is set, they will be removed from the type_list
once the last object is deallocated. */
-int unlist_types_without_objects;
-extern int tuple_zero_allocs, fast_tuple_allocs;
-extern int quick_int_allocs, quick_neg_int_allocs;
-extern int null_strings, one_strings;
+static int unlist_types_without_objects;
+extern Py_ssize_t _Py_tuple_zero_allocs, _Py_fast_tuple_allocs;
+extern Py_ssize_t _Py_quick_int_allocs, _Py_quick_neg_int_allocs;
+extern Py_ssize_t _Py_null_strings, _Py_one_strings;
void
dump_counts(FILE* f)
{
PyTypeObject *tp;
for (tp = type_list; tp; tp = tp->tp_next)
- fprintf(f, "%s alloc'd: %d, freed: %d, max in use: %d\n",
+ fprintf(f, "%s alloc'd: %zd, freed: %zd, max in use: %zd\n",
tp->tp_name, tp->tp_allocs, tp->tp_frees,
tp->tp_maxalloc);
- fprintf(f, "fast tuple allocs: %d, empty: %d\n",
- fast_tuple_allocs, tuple_zero_allocs);
- fprintf(f, "fast int allocs: pos: %d, neg: %d\n",
- quick_int_allocs, quick_neg_int_allocs);
- fprintf(f, "null strings: %d, 1-strings: %d\n",
- null_strings, one_strings);
+ fprintf(f, "fast tuple allocs: %zd, empty: %zd\n",
+ _Py_fast_tuple_allocs, _Py_tuple_zero_allocs);
+ fprintf(f, "fast int allocs: pos: %zd, neg: %zd\n",
+ _Py_quick_int_allocs, _Py_quick_neg_int_allocs);
+ fprintf(f, "null strings: %zd, 1-strings: %zd\n",
+ _Py_null_strings, _Py_one_strings);
}
PyObject *
Index: Objects/tupleobject.c
===================================================================
--- Objects/tupleobject.c (revision 68196)
+++ Objects/tupleobject.c (working copy)
@@ -19,8 +19,8 @@
static int numfree[PyTuple_MAXSAVESIZE];
#endif
#ifdef COUNT_ALLOCS
-int fast_tuple_allocs;
-int tuple_zero_allocs;
+Py_ssize_t _Py_fast_tuple_allocs;
+Py_ssize_t _Py_tuple_zero_allocs;
#endif
PyObject *
@@ -37,7 +37,7 @@
op = free_list[0];
Py_INCREF(op);
#ifdef COUNT_ALLOCS
- tuple_zero_allocs++;
+ _Py_tuple_zero_allocs++;
#endif
return (PyObject *) op;
}
@@ -45,7 +45,7 @@
free_list[size] = (PyTupleObject *) op->ob_item[0];
numfree[size]--;
#ifdef COUNT_ALLOCS
- fast_tuple_allocs++;
+ _Py_fast_tuple_allocs++;
#endif
/* Inline PyObject_InitVar */
#ifdef Py_TRACE_REFS
Index: Objects/intobject.c
===================================================================
--- Objects/intobject.c (revision 68196)
+++ Objects/intobject.c (working copy)
@@ -78,7 +78,8 @@
static PyIntObject *small_ints[NSMALLNEGINTS + NSMALLPOSINTS];
#endif
#ifdef COUNT_ALLOCS
-int quick_int_allocs, quick_neg_int_allocs;
+Py_ssize_t _Py_quick_int_allocs;
+Py_ssize_t _Py_quick_neg_int_allocs;
#endif
PyObject *
@@ -91,9 +92,9 @@
Py_INCREF(v);
#ifdef COUNT_ALLOCS
if (ival >= 0)
- quick_int_allocs++;
+ _Py_quick_int_allocs++;
else
- quick_neg_int_allocs++;
+ _Py_quick_neg_int_allocs++;
#endif
return (PyObject *) v;
}
Index: Objects/stringobject.c
===================================================================
--- Objects/stringobject.c (revision 68196)
+++ Objects/stringobject.c (working copy)
@@ -7,7 +7,7 @@
#include