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 #ifdef COUNT_ALLOCS -int null_strings, one_strings; +Py_ssize_t _Py_null_strings, _Py_one_strings; #endif static PyStringObject *characters[UCHAR_MAX + 1]; @@ -68,7 +68,7 @@ } if (size == 0 && (op = nullstring) != NULL) { #ifdef COUNT_ALLOCS - null_strings++; + _Py_null_strings++; #endif Py_INCREF(op); return (PyObject *)op; @@ -77,7 +77,7 @@ (op = characters[*str & UCHAR_MAX]) != NULL) { #ifdef COUNT_ALLOCS - one_strings++; + _Py_one_strings++; #endif Py_INCREF(op); return (PyObject *)op; @@ -130,14 +130,14 @@ } if (size == 0 && (op = nullstring) != NULL) { #ifdef COUNT_ALLOCS - null_strings++; + _Py_null_strings++; #endif Py_INCREF(op); return (PyObject *)op; } if (size == 1 && (op = characters[*str & UCHAR_MAX]) != NULL) { #ifdef COUNT_ALLOCS - one_strings++; + _Py_one_strings++; #endif Py_INCREF(op); return (PyObject *)op; @@ -1131,7 +1131,7 @@ v = PyString_FromStringAndSize(&pchar, 1); else { #ifdef COUNT_ALLOCS - one_strings++; + _Py_one_strings++; #endif Py_INCREF(v); }

AltStyle によって変換されたページ (->オリジナル) /