Commit d5495966 authored by Damien George's avatar Damien George
Browse files

py/scope: Shrink scope_t struct by 1 machine word.

On 32-bit archs this makes the scope_t struct 48 bytes in size, which fits
in 3 GC blocks (previously it used 4 GC blocks).  This will lead to some
savings when compiling scripts because there are usually quite a few scopes,
one for each function and class.

Note that qstrs will fit in 16 bits, this assumption is made in a few other
parent 3dea8c9e
......@@ -71,8 +71,8 @@ typedef struct _scope_t {
struct _scope_t *parent;
struct _scope_t *next;
mp_parse_node_t pn;
qstr source_file;
qstr simple_name;
uint16_t source_file; // a qstr
uint16_t simple_name; // a qstr
mp_raw_code_t *raw_code;
uint8_t scope_flags; // see runtime0.h
uint8_t emit_options; // see compile.h
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment