mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
bpo-40521: Always create the empty tuple singleton (GH-21116)
Py_InitializeFromConfig() now always creates the empty tuple singleton as soon as possible. Optimize PyTuple_New(0): it no longer has to check if the empty tuple was created or not, it is always creatd. * Add tuple_create_empty_tuple_singleton() function. * Add tuple_get_empty() function. * Remove state parameter of tuple_alloc().
This commit is contained in:
parent
80526f6841
commit
0430dfac62
3 changed files with 105 additions and 49 deletions
|
@ -34,6 +34,7 @@ PyAPI_FUNC(int) _Py_IsLocaleCoercionTarget(const char *ctype_loc);
|
|||
extern PyStatus _PyUnicode_Init(PyThreadState *tstate);
|
||||
extern int _PyStructSequence_Init(void);
|
||||
extern int _PyLong_Init(PyThreadState *tstate);
|
||||
extern PyStatus _PyTuple_Init(PyThreadState *tstate);
|
||||
extern PyStatus _PyFaulthandler_Init(int enable);
|
||||
extern int _PyTraceMalloc_Init(int enable);
|
||||
extern PyObject * _PyBuiltin_Init(PyThreadState *tstate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue