Change object representation from 1 big union to individual structs.
A big change. Micro Python objects are allocated as individual structs with the first element being a pointer to the type information (which is itself an object). This scheme follows CPython. Much more flexible, not necessarily slower, uses same heap memory, and can allocate objects statically. Also change name prefix, from py_ to mp_ (mp for Micro Python).
This commit is contained in:
@@ -37,7 +37,7 @@ typedef struct _scope_t {
|
||||
scope_kind_t kind;
|
||||
struct _scope_t *parent;
|
||||
struct _scope_t *next;
|
||||
py_parse_node_t pn;
|
||||
mp_parse_node_t pn;
|
||||
qstr simple_name;
|
||||
int id_info_alloc;
|
||||
int id_info_len;
|
||||
@@ -55,7 +55,7 @@ typedef struct _scope_t {
|
||||
uint emit_options;
|
||||
} scope_t;
|
||||
|
||||
scope_t *scope_new(scope_kind_t kind, py_parse_node_t pn, uint unique_code_id, uint emit_options);
|
||||
scope_t *scope_new(scope_kind_t kind, mp_parse_node_t pn, uint unique_code_id, uint emit_options);
|
||||
id_info_t *scope_find_or_add_id(scope_t *scope, qstr qstr, bool *added);
|
||||
id_info_t *scope_find(scope_t *scope, qstr qstr);
|
||||
id_info_t *scope_find_global(scope_t *scope, qstr qstr);
|
||||
|
||||
Reference in New Issue
Block a user