summaryrefslogtreecommitdiffstatshomepage
path: root/py/asmthumb.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-09-03 22:31:08 +0100
committerDamien George <damien.p.george@gmail.com>2014-09-03 22:31:08 +0100
commit91fbea2c1ec2012b6a7857930ca64cba1f9f9a56 (patch)
tree2112ee4a17967fe8bf1cedcc59d1934434bad309 /py/asmthumb.c
parentfc54250d3158bcd897d43187b822765fb97f369f (diff)
parentb7235b8412a7511c94b31c0391eaf5c1b35ed3a8 (diff)
downloadmicropython-91fbea2c1ec2012b6a7857930ca64cba1f9f9a56.tar.gz
micropython-91fbea2c1ec2012b6a7857930ca64cba1f9f9a56.zip
Merge pull request #845 from Vogtinator/master
Add allocation macros (per platform) and ARM cache flush
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);
}