summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-05-09 00:31:40 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-05-09 00:31:40 (GMT)
commitb4bbcd76ea312f3bb2304671e8b022266175a7ea (patch)
tree091438d6d574192213a5c24acf20dd702499a083 /Objects
parentcf5ad5d6f6e6db029b6e7701b8d964ad21406641 (diff)
downloadcpython-b4bbcd76ea312f3bb2304671e8b022266175a7ea.zip
cpython-b4bbcd76ea312f3bb2304671e8b022266175a7ea.tar.gz
cpython-b4bbcd76ea312f3bb2304671e8b022266175a7ea.tar.bz2
Ack! Restore the COUNT_ALLOCS one_strings code.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/stringobject.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 5bdbce9..8b51aab 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -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;
}