8000 GH-104580: Put `eval_breaker` back at the start of the interpreter st… · python/cpython@a1b6795 · GitHub
[go: up one dir, main page]

Skip to content

Commit a1b6795

Browse files
authored
GH-104580: Put eval_breaker back at the start of the interpreter state. (GH-107383)
1 parent 0aa58fa commit a1b6795

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Include/internal/pycore_ceval_state.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ struct _ceval_runtime_state {
8484

8585
struct _ceval_state {
8686
/* This single variable consolidates all requests to break out of
87-
the fast path in the eval loop. */
87+
* the fast path in the eval loop.
88+
* It is by far the hottest field in this struct and
89+
* should be placed at the beginning. */
8890
_Py_atomic_int eval_breaker;
8991
/* Request for dropping the GIL */
9092
_Py_atomic_int gil_drop_request;

Include/internal/pycore_interp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ struct _Py_long_state {
4848
*/
4949
struct _is {
5050

51+
/* This struct countains the eval_breaker,
52+
* which is by far the hottest field in this struct
53+
* and should be placed at the beginning. */
54+
struct _ceval_state ceval;
55+
5156
PyInterpreterState *next;
5257

5358
int64_t id;
@@ -109,8 +114,6 @@ struct _is {
109114
// Dictionary of the builtins module
110115
PyObject *builtins;
111116

112-
struct _ceval_state ceval;
113-
114117
struct _import_state imports;
115118

116119
/* The per-interpreter GIL, which might not be used. */

0 commit comments

Comments
 (0)
0