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 /py/compile.h | |
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 'py/compile.h')
-rw-r--r-- | py/compile.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/compile.h b/py/compile.h index 2d15de8b9..d3a64ba8a 100644 --- a/py/compile.h +++ b/py/compile.h @@ -40,8 +40,8 @@ enum { }; // the compiler will raise an exception if an error occurred -// the compiler will free the parse tree (pn) before it returns -mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, uint emit_opt, bool is_repl); +// the compiler will clear the parse tree before it returns +mp_obj_t mp_compile(mp_parse_tree_t *parse_tree, qstr source_file, uint emit_opt, bool is_repl); // this is implemented in runtime.c mp_obj_t mp_parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t parse_input_kind, mp_obj_dict_t *globals, mp_obj_dict_t *locals); |