diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-24 22:42:28 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-24 22:42:28 +0000 |
commit | 41d02b654e5c844f85fbb79283eaebf35af60fbb (patch) | |
tree | 224166f307256d81c08564546634106f7a8b0435 /py/emit.h | |
parent | ceb87835fe24873cd8b2f7d1d3d88cb6144e33b8 (diff) | |
download | micropython-41d02b654e5c844f85fbb79283eaebf35af60fbb.tar.gz micropython-41d02b654e5c844f85fbb79283eaebf35af60fbb.zip |
py: Improve freeing of emitters in mp_compile.
There can be multiple emitters allocated during compile (eg byte code
and native).
Diffstat (limited to 'py/emit.h')
-rw-r--r-- | py/emit.h | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -17,8 +17,6 @@ typedef enum { typedef struct _emit_t emit_t; typedef struct _emit_method_table_t { - void (*free)(emit_t *emit); - void (*set_native_types)(emit_t *emit, bool do_native_types); void (*start_pass)(emit_t *emit, pass_kind_t pass, scope_t *scope); void (*end_pass)(emit_t *emit); @@ -120,12 +118,16 @@ extern const emit_method_table_t emit_native_x64_method_table; extern const emit_method_table_t emit_native_thumb_method_table; emit_t *emit_pass1_new(qstr qstr___class__); -void emit_pass1_free(emit_t *emit); emit_t *emit_cpython_new(uint max_num_labels); emit_t *emit_bc_new(uint max_num_labels); emit_t *emit_native_x64_new(uint max_num_labels); emit_t *emit_native_thumb_new(uint max_num_labels); +void emit_pass1_free(emit_t *emit); +void emit_bc_free(emit_t *emit); +void emit_native_x64_free(emit_t *emit); +void emit_native_thumb_free(emit_t *emit); + typedef struct _emit_inline_asm_t emit_inline_asm_t; typedef struct _emit_inline_asm_method_table_t { @@ -139,3 +141,5 @@ typedef struct _emit_inline_asm_method_table_t { extern const emit_inline_asm_method_table_t emit_inline_thumb_method_table; emit_inline_asm_t *emit_inline_thumb_new(uint max_num_labels); +void emit_inline_thumb_free(emit_inline_asm_t *emit); + |