@@ -27,7 +27,7 @@ typedef struct {
2727 PyObject * schedule_hook ; /* the schedule callback function */
2828 slp_schedule_hook_func * schedule_fasthook ; /* the fast C-only schedule_hook */
2929 PyThreadState * initial_tstate ; /* recording the main thread state */
30- int enable_softswitch ; /* the flag which decides whether we try to use soft switching */
30+ uint8_t enable_softswitch ; /* the flag which decides whether we try to use soft switching */
3131} PyStacklessInterpreterState ;
3232
3333#define SPL_INTERPRETERSTATE_NEW (interp ) \
@@ -94,12 +94,10 @@ typedef struct _sts {
9494 PyObject * unwinding_retval ; /* The return value during stack unwinding */
9595 Py_ssize_t frame_refcnt ; /* The number of owned references to frames */
9696 int runcount ;
97- /* trap recursive scheduling via callbacks */
98- int schedlock ;
99- int runflags ; /* flags for stackless.run() behaviour */
100- /* number of nested interpreters (1.0/2.0 merge) */
101- int nesting_level ;
97+ int nesting_level ; /* number of nested interpreters */
10298 int switch_trap ; /* if non-zero, switching is forbidden */
99+ uint8_t schedlock ; /* trap recursive scheduling via callbacks */
100+ uint8_t runflags ; /* flags for stackless.run() behaviour */
103101#ifdef SLP_WITH_FRAME_REF_DEBUG
104102 struct _frame * next_frame ; /* a ref counted copy of PyThreadState.frame */
105103#endif
@@ -108,7 +106,7 @@ typedef struct _sts {
108106#ifdef Py_BUILD_CORE
109107
110108/* internal macro to temporarily disable soft interrupts */
111- #define PY_WATCHDOG_NO_SOFT_IRQ (1<<31 )
109+ #define PY_WATCHDOG_NO_SOFT_IRQ (1U<<7 )
112110
113111/* these macros go into pystate.c */
114112#ifdef SLP_WITH_FRAME_REF_DEBUG
@@ -137,10 +135,10 @@ typedef struct _sts {
137135 tstate->st.unwinding_retval = NULL; \
138136 tstate->st.frame_refcnt = 0; \
139137 tstate->st.runcount = 0; \
140- tstate->st.schedlock = 0; \
141138 tstate->st.nesting_level = 0; \
142- tstate->st.runflags = 0; \
143139 tstate->st.switch_trap = 0; \
140+ tstate->st.schedlock = 0; \
141+ tstate->st.runflags = 0; \
144142 __STACKLESS_PYSTATE_NEW_NEXT_FRAME
145143
146144
0 commit comments