diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-09 12:27:39 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-09 12:27:39 +0100 |
commit | 78035b995ff7bd518cc1291aa70c966b53510fd9 (patch) | |
tree | b401d96d1a29db9cc7c87beedc9c829cc46e56f8 /py/scope.c | |
parent | fc18c8e834a1ed72b9f61d82cd00099a4de1eab4 (diff) |
py, compiler: Clean up and compress scope/compile structures.
Convert int types to uint where sensible, and then to uint8_t or
uint16_t where possible to reduce RAM usage.
Diffstat (limited to 'py/scope.c')
-rw-r--r-- | py/scope.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/py/scope.c b/py/scope.c index cc4be7c85..d55a4ddea 100644 --- a/py/scope.c +++ b/py/scope.c @@ -10,10 +10,8 @@ #include "scope.h" scope_t *scope_new(scope_kind_t kind, mp_parse_node_t pn, qstr source_file, uint unique_code_id, uint emit_options) { - scope_t *scope = m_new(scope_t, 1); + scope_t *scope = m_new0(scope_t, 1); scope->kind = kind; - scope->parent = NULL; - scope->next = NULL; scope->pn = pn; scope->source_file = source_file; switch (kind) { @@ -43,19 +41,10 @@ scope_t *scope_new(scope_kind_t kind, mp_parse_node_t pn, qstr source_file, uint default: assert(0); } - scope->id_info_alloc = 8; - scope->id_info_len = 0; - scope->id_info = m_new(id_info_t, scope->id_info_alloc); - - scope->scope_flags = 0; - scope->num_params = 0; - /* not needed - scope->num_default_params = 0; - scope->num_dict_params = 0; - */ - scope->num_locals = 0; scope->unique_code_id = unique_code_id; scope->emit_options = emit_options; + scope->id_info_alloc = 8; + scope->id_info = m_new(id_info_t, scope->id_info_alloc); return scope; } |