diff options
| author | Damien George <damien.p.george@gmail.com> | 2015-09-23 10:50:43 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2015-10-02 00:11:11 +0100 |
| commit | 58e0f4ac50b3dc732cbfe0d7b04bb41951ac1329 (patch) | |
| tree | 46b94d7f78766e545c0bbda3febeeaf6d7a4bec0 /stmhal/pyexec.c | |
| parent | e5635f4ab3d0fd00dd3951865fea82003205dae1 (diff) | |
py: Allocate parse nodes in chunks to reduce fragmentation and RAM use.
With this patch parse nodes are allocated sequentially in chunks. This
reduces fragmentation of the heap and prevents waste at the end of
individually allocated parse nodes.
Saves roughly 20% of RAM during parse stage.
Diffstat (limited to 'stmhal/pyexec.c')
| -rw-r--r-- | stmhal/pyexec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stmhal/pyexec.c b/stmhal/pyexec.c index aa7e35390..c692933dc 100644 --- a/stmhal/pyexec.c +++ b/stmhal/pyexec.c @@ -64,8 +64,8 @@ STATIC int parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t input_ki if (nlr_push(&nlr) == 0) { // parse and compile the script qstr source_name = lex->source_name; - mp_parse_node_t pn = mp_parse(lex, input_kind); - mp_obj_t module_fun = mp_compile(pn, source_name, MP_EMIT_OPT_NONE, exec_flags & EXEC_FLAG_IS_REPL); + mp_parse_tree_t parse_tree = mp_parse(lex, input_kind); + mp_obj_t module_fun = mp_compile(&parse_tree, source_name, MP_EMIT_OPT_NONE, exec_flags & EXEC_FLAG_IS_REPL); // execute code mp_hal_set_interrupt_char(CHAR_CTRL_C); // allow ctrl-C to interrupt us |
