summaryrefslogtreecommitdiffstatshomepage
path: root/py/asmthumb.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/asmthumb.c')
-rw-r--r--py/asmthumb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/py/asmthumb.c b/py/asmthumb.c
index 1102bb74ab..95f87783ad 100644
--- a/py/asmthumb.c
+++ b/py/asmthumb.c
@@ -67,7 +67,7 @@ asm_thumb_t *asm_thumb_new(uint max_num_labels) {
void asm_thumb_free(asm_thumb_t *as, bool free_code) {
if (free_code) {
- m_del(byte, as->code_base, as->code_size);
+ MP_PLAT_FREE_EXEC(as->code_base, as->code_size);
}
/*
if (as->label != NULL) {
@@ -94,9 +94,10 @@ void asm_thumb_start_pass(asm_thumb_t *as, uint pass) {
void asm_thumb_end_pass(asm_thumb_t *as) {
if (as->pass == ASM_THUMB_PASS_COMPUTE) {
- // calculate size of code in bytes
- as->code_size = as->code_offset;
- as->code_base = m_new(byte, as->code_size);
+ MP_PLAT_ALLOC_EXEC(as->code_offset, (void**) &as->code_base, &as->code_size);
+ if(as->code_base == NULL) {
+ assert(0);
+ }
//printf("code_size: %u\n", as->code_size);
}