diff options
author | Mark Shannon <mark@hotpy.org> | 2023-07-28 12:55:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 12:55:25 (GMT) |
commit | a1b679572e7156bc4299819e73235dc608d4a570 (patch) | |
tree | 9776cc6957b3ce693d30baeed44bd671422e8581 /Include | |
parent | 0aa58fa7a62cd0ee7ec27fa87122425aeff0467d (diff) | |
download | cpython-a1b679572e7156bc4299819e73235dc608d4a570.zip cpython-a1b679572e7156bc4299819e73235dc608d4a570.tar.gz cpython-a1b679572e7156bc4299819e73235dc608d4a570.tar.bz2 |
GH-104580: Put `eval_breaker` back at the start of the interpreter state. (GH-107383)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_ceval_state.h | 4 | ||||
-rw-r--r-- | Include/internal/pycore_interp.h | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/Include/internal/pycore_ceval_state.h b/Include/internal/pycore_ceval_state.h index e56e43c..1ebfcc9 100644 --- a/Include/internal/pycore_ceval_state.h +++ b/Include/internal/pycore_ceval_state.h @@ -84,7 +84,9 @@ struct _ceval_runtime_state { struct _ceval_state { /* 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; /* Request for dropping the GIL */ _Py_atomic_int gil_drop_request; diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index bd6a9f2..91c473e 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -48,6 +48,11 @@ struct _Py_long_state { */ 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; int64_t id; @@ -109,8 +114,6 @@ struct _is { // Dictionary of the builtins module PyObject *builtins; - struct _ceval_state ceval; - struct _import_state imports; /* The per-interpreter GIL, which might not be used. */ |