mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-45953: Statically allocate and initialize global bytes objects. (gh-30096)
The empty bytes object (b'') and the 256 one-character bytes objects were allocated at runtime init. Now we statically allocate and initialize them. https://bugs.python.org/issue45953
This commit is contained in:
parent
6f05e1ec19
commit
cf496d657a
5 changed files with 294 additions and 96 deletions
|
@ -11,17 +11,7 @@ extern "C" {
|
|||
|
||||
/* runtime lifecycle */
|
||||
|
||||
extern PyStatus _PyBytes_InitGlobalObjects(PyInterpreterState *);
|
||||
extern PyStatus _PyBytes_InitTypes(PyInterpreterState *);
|
||||
extern void _PyBytes_Fini(PyInterpreterState *);
|
||||
|
||||
|
||||
/* other API */
|
||||
|
||||
struct _Py_bytes_state {
|
||||
PyObject *empty_string;
|
||||
PyBytesObject *characters[256];
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue