]> granicus.if.org Git - python/commitdiff
Merged revisions 68381 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Sun, 11 Jan 2009 17:13:55 +0000 (17:13 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 11 Jan 2009 17:13:55 +0000 (17:13 +0000)
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.
........

Objects/bytesobject.c
Objects/object.c
Objects/tupleobject.c

index b28a554331dcfd895ea661547ed1c9656526f119..f9569a7b1fdaa12ae62817a9550d0be9846a0fbb 100644 (file)
@@ -26,7 +26,7 @@ _getbuffer(PyObject *obj, Py_buffer *view)
 }
 
 #ifdef COUNT_ALLOCS
-int null_strings, one_strings;
+Py_ssize_t null_strings, one_strings;
 #endif
 
 static PyBytesObject *characters[UCHAR_MAX + 1];
index bf0e6d174dc0712184bad44e356572088ff7d086..15d26a79883d1c89bfbb3cbce6cf9cf8f80f7d88 100644 (file)
@@ -81,24 +81,29 @@ static PyTypeObject *type_list;
    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 tuple_zero_allocs, fast_tuple_allocs;
+extern Py_ssize_t quick_int_allocs, quick_neg_int_allocs;
+extern Py_ssize_t null_strings, 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: %" PY_FORMAT_SIZE_T "d, "
+                       "freed: %" PY_FORMAT_SIZE_T "d, "
+                       "max in use: %" PY_FORMAT_SIZE_T "d\n",
                        tp->tp_name, tp->tp_allocs, tp->tp_frees,
                        tp->tp_maxalloc);
-       fprintf(f, "fast tuple allocs: %d, empty: %d\n",
+       fprintf(f, "fast tuple allocs: %" PY_FORMAT_SIZE_T "d, "
+               "empty: %" PY_FORMAT_SIZE_T "d\n",
                fast_tuple_allocs, tuple_zero_allocs);
-       fprintf(f, "fast int allocs: pos: %d, neg: %d\n",
+       fprintf(f, "fast int allocs: pos: %" PY_FORMAT_SIZE_T "d, "
+               "neg: %" PY_FORMAT_SIZE_T "d\n",
                quick_int_allocs, quick_neg_int_allocs);
-       fprintf(f, "null strings: %d, 1-strings: %d\n",
+       fprintf(f, "null strings: %" PY_FORMAT_SIZE_T "d, "
+               "1-strings: %" PY_FORMAT_SIZE_T "d\n",
                null_strings, one_strings);
 }
 
index 679ba8f5851d845a0e0be545ca87f6c680f8b6dd..9da05ee274c6420954bd72b6f7c09e378ab64b86 100644 (file)
@@ -19,8 +19,8 @@ static PyTupleObject *free_list[PyTuple_MAXSAVESIZE];
 static int numfree[PyTuple_MAXSAVESIZE];
 #endif
 #ifdef COUNT_ALLOCS
-int fast_tuple_allocs;
-int tuple_zero_allocs;
+Py_ssize_t fast_tuple_allocs;
+Py_ssize_t tuple_zero_allocs;
 #endif
 
 PyObject *