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 /bare-arm/main.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 'bare-arm/main.c')
| -rw-r--r-- | bare-arm/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bare-arm/main.c b/bare-arm/main.c index 6f5707afe..c5a7fe060 100644 --- a/bare-arm/main.c +++ b/bare-arm/main.c @@ -16,8 +16,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 { |
