mirror of
https://github.com/python/cpython.git
synced 2025-10-08 08:01:55 +00:00
bpo-35064 prefix smelly symbols that appear with COUNT_ALLOCS with _Py_ (GH-10152)
Configuring python with ./configure --with-pydebug CFLAGS="-D COUNT_ALLOCS -O0" makes "make smelly" fail as some symbols were being exported without the "Py_" or "_Py" prefixes.
This commit is contained in:
parent
6015cc50bc
commit
49c75a8086
7 changed files with 31 additions and 31 deletions
|
@ -18,7 +18,7 @@ class bytes "PyBytesObject *" "&PyBytes_Type"
|
|||
#include "clinic/bytesobject.c.h"
|
||||
|
||||
#ifdef COUNT_ALLOCS
|
||||
Py_ssize_t null_strings, one_strings;
|
||||
Py_ssize_t _Py_null_strings, _Py_one_strings;
|
||||
#endif
|
||||
|
||||
static PyBytesObject *characters[UCHAR_MAX + 1];
|
||||
|
@ -66,7 +66,7 @@ _PyBytes_FromSize(Py_ssize_t size, int use_calloc)
|
|||
|
||||
if (size == 0 && (op = nullstring) != NULL) {
|
||||
#ifdef COUNT_ALLOCS
|
||||
null_strings++;
|
||||
_Py_null_strings++;
|
||||
#endif
|
||||
Py_INCREF(op);
|
||||
return (PyObject *)op;
|
||||
|
@ -110,7 +110,7 @@ PyBytes_FromStringAndSize(const char *str, Py_ssize_t size)
|
|||
(op = characters[*str & UCHAR_MAX]) != NULL)
|
||||
{
|
||||
#ifdef COUNT_ALLOCS
|
||||
one_strings++;
|
||||
_Py_one_strings++;
|
||||
#endif
|
||||
Py_INCREF(op);
|
||||
return (PyObject *)op;
|
||||
|
@ -146,14 +146,14 @@ PyBytes_FromString(const char *str)
|
|||
}
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue