mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
Ack! Restore the COUNT_ALLOCS one_strings code.
This commit is contained in:
parent
cf5ad5d6f6
commit
b4bbcd76ea
1 changed files with 5 additions and 1 deletions
|
@ -563,8 +563,12 @@ string_item(PyStringObject *a, register int i)
|
||||||
v = (PyObject *)characters[*pchar & UCHAR_MAX];
|
v = (PyObject *)characters[*pchar & UCHAR_MAX];
|
||||||
if (v == NULL)
|
if (v == NULL)
|
||||||
v = PyString_FromStringAndSize(pchar, 1);
|
v = PyString_FromStringAndSize(pchar, 1);
|
||||||
else
|
else {
|
||||||
|
#ifdef COUNT_ALLOCS
|
||||||
|
one_strings++;
|
||||||
|
#endif
|
||||||
Py_INCREF(v);
|
Py_INCREF(v);
|
||||||
|
}
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue