Skip to content

Commit b4bbcd7

Browse files
committed
Ack! Restore the COUNT_ALLOCS one_strings code.
1 parent cf5ad5d commit b4bbcd7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Objects/stringobject.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,12 @@ string_item(PyStringObject *a, register int i)
563563
v = (PyObject *)characters[*pchar & UCHAR_MAX];
564564
if (v == NULL)
565565
v = PyString_FromStringAndSize(pchar, 1);
566-
else
566+
else {
567+
#ifdef COUNT_ALLOCS
568+
one_strings++;
569+
#endif
567570
Py_INCREF(v);
571+
}
568572
return v;
569573
}
570574

0 commit comments

Comments
 (0)