mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +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
|
@ -678,11 +678,6 @@ pycore_init_global_objects(PyInterpreterState *interp)
|
|||
|
||||
_PyFloat_InitState(interp);
|
||||
|
||||
status = _PyBytes_InitGlobalObjects(interp);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
status = _PyUnicode_InitGlobalObjects(interp);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
|
@ -1685,7 +1680,6 @@ finalize_interp_types(PyInterpreterState *interp)
|
|||
|
||||
_PySlice_Fini(interp);
|
||||
|
||||
_PyBytes_Fini(interp);
|
||||
_PyUnicode_Fini(interp);
|
||||
_PyFloat_Fini(interp);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue