diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-10-29 22:34:59 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-10-29 22:34:59 +0200 |
| commit | 446e735825efe83907c1056b22d2d3e11345b76e (patch) | |
| tree | 713b960a61539b88f4318eb5719e30cf5ef69bfc /src | |
| parent | 0e47d1269cc660d2b1451e76375b2d3545ce66f4 (diff) | |
| download | box64-446e735825efe83907c1056b22d2d3e11345b76e.tar.gz box64-446e735825efe83907c1056b22d2d3e11345b76e.zip | |
[DYNAREC] Small change to use alloca instead of customMalloc
Diffstat (limited to 'src')
| -rwxr-xr-x | src/dynarec/dynarec_native.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/dynarec/dynarec_native.c b/src/dynarec/dynarec_native.c index 44854dce..9da18cf6 100755 --- a/src/dynarec/dynarec_native.c +++ b/src/dynarec/dynarec_native.c @@ -386,8 +386,6 @@ void CancelBlock64() customFree(helper->next); customFree(helper->insts); customFree(helper->table64); - customFree(helper->sons_x64); - customFree(helper->sons_native); if(helper->dynablock && helper->dynablock->block) FreeDynarecMap(helper->dynablock, (uintptr_t)helper->dynablock->block, helper->dynablock->size); } @@ -519,8 +517,8 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr) { helper.native_start = (uintptr_t)p; helper.tablestart = helper.native_start + helper.native_size; if(helper.sons_size) { - helper.sons_x64 = (uintptr_t*)customCalloc(helper.sons_size, sizeof(uintptr_t)); - helper.sons_native = (void**)customCalloc(helper.sons_size, sizeof(void*)); + helper.sons_x64 = (uintptr_t*)alloca(helper.sons_size*sizeof(uintptr_t)); + helper.sons_native = (void**)alloca(helper.sons_size*sizeof(void*)); } int pass2_sons_size = helper.sons_size; // pass 3, emit (log emit native opcode) @@ -619,10 +617,6 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr) { } else customFree(sons); } - customFree(helper.sons_x64); - helper.sons_x64 = NULL; - customFree(helper.sons_native); - helper.sons_native = NULL; current_helper = NULL; //block->done = 1; return (void*)block; |