]> granicus.if.org Git - python/commitdiff
Ack! Restore the COUNT_ALLOCS one_strings code.
authorTim Peters <tim.peters@gmail.com>
Wed, 9 May 2001 00:31:40 +0000 (00:31 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 9 May 2001 00:31:40 +0000 (00:31 +0000)
Objects/stringobject.c

index 5bdbce9d594c9f19d97242d861739bf050edf133..8b51aaba5a5155c502367d45255f7be8ff7e712d 100644 (file)
@@ -563,8 +563,12 @@ string_item(PyStringObject *a, register int i)
        v = (PyObject *)characters[*pchar & UCHAR_MAX];
        if (v == NULL)
                v = PyString_FromStringAndSize(pchar, 1);
-       else
+       else {
+#ifdef COUNT_ALLOCS
+               one_strings++;
+#endif
                Py_INCREF(v);
+       }
        return v;
 }