mirror of https://github.com/python/cpython
GH-104580: Put `eval_breaker` back at the start of the interpreter state. (GH-107383)
This commit is contained in:
parent
0aa58fa7a6
commit
a1b679572e
|
@ -84,7 +84,9 @@ struct _ceval_runtime_state {
|
||||||
|
|
||||||
struct _ceval_state {
|
struct _ceval_state {
|
||||||
/* This single variable consolidates all requests to break out of
|
/* This single variable consolidates all requests to break out of
|
||||||
the fast path in the eval loop. */
|
* the fast path in the eval loop.
|
||||||
|
* It is by far the hottest field in this struct and
|
||||||
|
* should be placed at the beginning. */
|
||||||
_Py_atomic_int eval_breaker;
|
_Py_atomic_int eval_breaker;
|
||||||
/* Request for dropping the GIL */
|
/* Request for dropping the GIL */
|
||||||
_Py_atomic_int gil_drop_request;
|
_Py_atomic_int gil_drop_request;
|
||||||
|
|
|
@ -48,6 +48,11 @@ struct _Py_long_state {
|
||||||
*/
|
*/
|
||||||
struct _is {
|
struct _is {
|
||||||
|
|
||||||
|
/* This struct countains the eval_breaker,
|
||||||
|
* which is by far the hottest field in this struct
|
||||||
|
* and should be placed at the beginning. */
|
||||||
|
struct _ceval_state ceval;
|
||||||
|
|
||||||
PyInterpreterState *next;
|
PyInterpreterState *next;
|
||||||
|
|
||||||
int64_t id;
|
int64_t id;
|
||||||
|
@ -109,8 +114,6 @@ struct _is {
|
||||||
// Dictionary of the builtins module
|
// Dictionary of the builtins module
|
||||||
PyObject *builtins;
|
PyObject *builtins;
|
||||||
|
|
||||||
struct _ceval_state ceval;
|
|
||||||
|
|
||||||
struct _import_state imports;
|
struct _import_state imports;
|
||||||
|
|
||||||
/* The per-interpreter GIL, which might not be used. */
|
/* The per-interpreter GIL, which might not be used. */
|
||||||
|
|
Loading…
Reference in New Issue