Skip to content

Commit c1d855f

Browse files
use bitfields in _asyncio
1 parent b58bc8c commit c1d855f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Modules/_asynciomodule.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,26 +119,26 @@ typedef enum {
119119
PyObject *prefix##_result; \
120120
PyObject *prefix##_source_tb; \
121121
PyObject *prefix##_cancel_msg; \
122-
fut_state prefix##_state; \
123-
int prefix##_log_tb; \
124-
int prefix##_blocking; \
125122
PyObject *dict; \
126123
PyObject *prefix##_weakreflist; \
127-
PyObject *prefix##_cancelled_exc;
124+
PyObject *prefix##_cancelled_exc; \
125+
fut_state prefix##_state: 2; \
126+
unsigned prefix##_log_tb: 1; \
127+
unsigned prefix##_blocking: 1;
128128

129129
typedef struct {
130130
FutureObj_HEAD(fut)
131131
} FutureObj;
132132

133133
typedef struct {
134134
FutureObj_HEAD(task)
135+
unsigned task_must_cancel: 1;
136+
unsigned task_log_destroy_pending: 1;
137+
int task_num_cancels_requested;
135138
PyObject *task_fut_waiter;
136139
PyObject *task_coro;
137140
PyObject *task_name;
138141
PyObject *task_context;
139-
int task_must_cancel;
140-
int task_log_destroy_pending;
141-
int task_num_cancels_requested;
142142
} TaskObj;
143143

144144
typedef struct {

0 commit comments

Comments
 (0)