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 /minimal | |
parent | e5635f4ab3d0fd00dd3951865fea82003205dae1 (diff) | |
download | micropython-58e0f4ac50b3dc732cbfe0d7b04bb41951ac1329.tar.gz micropython-58e0f4ac50b3dc732cbfe0d7b04bb41951ac1329.zip |
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 'minimal')
-rw-r--r-- | minimal/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/minimal/main.c b/minimal/main.c index 11f1d3ad6b..dc34d89bc0 100644 --- a/minimal/main.c +++ b/minimal/main.c @@ -19,8 +19,8 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) { nlr_buf_t nlr; if (nlr_push(&nlr) == 0) { 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, true); + 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, true); mp_call_function_0(module_fun); nlr_pop(); } else { |