Skip to content

Commit 8dc768b

Browse files
committed
objgenerator: Add comments for latest mp_obj_gen_instance_t refactors.
1 parent 3ec0a1a commit 8dc768b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

py/objgenerator.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ typedef struct _mp_obj_gen_instance_t {
5656
const byte *code_info;
5757
const byte *ip;
5858
mp_obj_t *sp;
59+
// bit 0 is saved currently_in_except_block value
5960
mp_exc_stack *exc_sp;
6061
uint n_state;
61-
mp_obj_t state[0]; // Variable-length
62-
mp_exc_stack exc_state[0]; // Variable-length
62+
// Variable-length
63+
mp_obj_t state[0];
64+
// Variable-length, never accessed by name, only as (void*)(state + n_state)
65+
mp_exc_stack exc_state[0];
6366
} mp_obj_gen_instance_t;
6467

6568
void gen_instance_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {

0 commit comments

Comments
 (0)