mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-40521: Make empty Unicode string per interpreter (GH-21096)
Each interpreter now has its own empty Unicode string singleton.
This commit is contained in:
parent
d051801052
commit
f363d0a6e9
12 changed files with 130 additions and 90 deletions
|
@ -71,6 +71,8 @@ struct _Py_bytes_state {
|
|||
};
|
||||
|
||||
struct _Py_unicode_state {
|
||||
// The empty Unicode object is a singleton to improve performance.
|
||||
PyObject *empty;
|
||||
struct _Py_unicode_fs_codec fs_codec;
|
||||
};
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ PyAPI_FUNC(int) _Py_IsLocaleCoercionTarget(const char *ctype_loc);
|
|||
|
||||
/* Various one-time initializers */
|
||||
|
||||
extern PyStatus _PyUnicode_Init(void);
|
||||
extern PyStatus _PyUnicode_Init(PyThreadState *tstate);
|
||||
extern int _PyStructSequence_Init(void);
|
||||
extern int _PyLong_Init(PyThreadState *tstate);
|
||||
extern PyStatus _PyFaulthandler_Init(int enable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue