diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-24 14:32:40 -0800 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-24 14:32:40 -0800 |
commit | ceb87835fe24873cd8b2f7d1d3d88cb6144e33b8 (patch) | |
tree | be3e0b2da874ab98f98a4fd756ff8534f74b5b6d /py/emitnative.c | |
parent | 4461970da027ce16b41189f75257239f46a3b087 (diff) | |
parent | f46d87a30d09bfa904c2b9769ea52271abb86b0c (diff) | |
download | micropython-ceb87835fe24873cd8b2f7d1d3d88cb6144e33b8.tar.gz micropython-ceb87835fe24873cd8b2f7d1d3d88cb6144e33b8.zip |
Merge pull request #217 from pfalcon/free-emitter
Add support for freeing code emitter objects at the end of compilation.
Diffstat (limited to 'py/emitnative.c')
-rw-r--r-- | py/emitnative.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/py/emitnative.c b/py/emitnative.c index 6fc1742489..ddda90659e 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -146,6 +146,15 @@ emit_t *EXPORT_FUN(new)(uint max_num_labels) { return emit; } +static void emit_native_free(emit_t *emit) { +#if N_X64 + asm_x64_free(emit->as, false); +#elif N_THUMB + asm_thumb_free(emit->as, false); +#endif + m_del_obj(emit_t, emit); +} + static void emit_native_set_viper_types(emit_t *emit, bool do_viper_types) { emit->do_viper_types = do_viper_types; } @@ -1226,6 +1235,8 @@ static void emit_native_yield_from(emit_t *emit) { } const emit_method_table_t EXPORT_FUN(method_table) = { + emit_native_free, + emit_native_set_viper_types, emit_native_start_pass, emit_native_end_pass, |