Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 26889:12753e7b15f7 legacy-trunk
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.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Mon, 30 Dec 2002 22:29:22 +0000 |
| parents | 54aacb87beda |
| children | dbfc3ef7d003 |
comparison
equal
deleted
inserted
replaced
| 26888:b9c1597d8102 | 26889:12753e7b15f7 |
|---|---|
| 121 if (tstate == NULL) | 121 if (tstate == NULL) |
| 122 Py_FatalError("Py_Initialize: can't make first thread"); | 122 Py_FatalError("Py_Initialize: can't make first thread"); |
| 123 (void) PyThreadState_Swap(tstate); | 123 (void) PyThreadState_Swap(tstate); |
| 124 | 124 |
| 125 _Py_ReadyTypes(); | 125 _Py_ReadyTypes(); |
| 126 | |
| 127 if (!PyFrame_Init()) | |
| 128 Py_FatalError("Py_Initialize: can't init frames"); | |
| 129 | |
| 130 if (!PyInt_Init()) | |
| 131 Py_FatalError("Py_Initialize: can't init ints"); | |
| 126 | 132 |
| 127 interp->modules = PyDict_New(); | 133 interp->modules = PyDict_New(); |
| 128 if (interp->modules == NULL) | 134 if (interp->modules == NULL) |
| 129 Py_FatalError("Py_Initialize: can't make modules dictionary"); | 135 Py_FatalError("Py_Initialize: can't make modules dictionary"); |
| 130 | 136 |
