mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +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
|
@ -10,7 +10,6 @@ extern "C" {
|
|||
|
||||
#include "pycore_atomic.h" // _Py_atomic_address
|
||||
#include "pycore_ast_state.h" // struct ast_state
|
||||
#include "pycore_bytesobject.h" // struct _Py_bytes_state
|
||||
#include "pycore_context.h" // struct _Py_context_state
|
||||
#include "pycore_dict.h" // struct _Py_dict_state
|
||||
#include "pycore_exceptions.h" // struct _Py_exc_state
|
||||
|
@ -152,7 +151,6 @@ struct _is {
|
|||
|
||||
PyObject *audit_hooks;
|
||||
|
||||
struct _Py_bytes_state bytes;
|
||||
struct _Py_unicode_state unicode;
|
||||
struct _Py_float_state float_state;
|
||||
/* Using a cache is very effective since typically only a single slice is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue