summaryrefslogtreecommitdiffstatshomepage
path: root/py/emit.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-24 22:42:28 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-24 22:42:28 +0000
commit41d02b654e5c844f85fbb79283eaebf35af60fbb (patch)
tree224166f307256d81c08564546634106f7a8b0435 /py/emit.h
parentceb87835fe24873cd8b2f7d1d3d88cb6144e33b8 (diff)
downloadmicropython-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.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/py/emit.h b/py/emit.h
index c4d38530cd..fc5538f586 100644
--- a/py/emit.h
+++ b/py/emit.h
@@ -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);
+