mirror of
https://github.com/python/cpython
synced 2026-09-29 11:35:29 +03:00
SF #561244, Micro optimizations
Initialize the small integers and __builtins__ in startup. This removes some if conditions. Change XDECREF to DECREF for values which shouldn't be NULL.
This commit is contained in:
parent
83f898c86c
commit
c91ed400e0
5 changed files with 44 additions and 19 deletions
|
|
@ -30,6 +30,7 @@ PyAPI_DATA(PyTypeObject) PyInt_Type;
|
|||
#define PyInt_Check(op) PyObject_TypeCheck(op, &PyInt_Type)
|
||||
#define PyInt_CheckExact(op) ((op)->ob_type == &PyInt_Type)
|
||||
|
||||
PyAPI_FUNC(int) PyInt_Init(void);
|
||||
PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int);
|
||||
#ifdef Py_USING_UNICODE
|
||||
PyAPI_FUNC(PyObject *) PyInt_FromUnicode(Py_UNICODE*, int, int);
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ PyAPI_FUNC(PyObject *) _PySys_Init(void);
|
|||
PyAPI_FUNC(void) _PyImport_Init(void);
|
||||
PyAPI_FUNC(void) _PyExc_Init(void);
|
||||
PyAPI_FUNC(void) _PyImportHooks_Init(void);
|
||||
PyAPI_FUNC(int) PyFrame_Init(void);
|
||||
|
||||
/* Various internal finalizers */
|
||||
PyAPI_FUNC(void) _PyExc_Fini(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue