diff --git a/desmume/src/utils/arm_jit/arm_jit_arm.cpp b/desmume/src/utils/arm_jit/arm_jit_arm.cpp index 4d8649a80..e4bf0be4c 100755 --- a/desmume/src/utils/arm_jit/arm_jit_arm.cpp +++ b/desmume/src/utils/arm_jit/arm_jit_arm.cpp @@ -4116,10 +4116,7 @@ static u32 compile_basicblock() emit_endfunc(g_out); ArmOpCompiled f; - - f = createFunc(g_out); - g_out = NULL; jit_exec(); @@ -4177,8 +4174,8 @@ void arm_jit_reset(bool enable, bool suppress_msg) #ifdef MAPPED_JIT_FUNCS //these pointers are allocated by asmjit and need freeing - #define JITFREE(x) for(int iii=0;iiifree((void*)x[iii]); memset(x,0,sizeof(x)); -/* JITFREE(JIT.MAIN_MEM); +#define JITFREE(x) for(int iii=0;iii::iterator it; for (it=allFuncs.begin(); it!=allFuncs.end(); ++it) { - // TODO: Calling munmap() causes a crash when resetting the emulator. Need to research why this happens. - //munmap((void *)it->first, (uintptr_t)it->second); + munmap((void *)it->first, (uintptr_t)it->second); } allFuncs.clear(); + g_curr_jit_block = NULL; } static void allocNewBlock() { @@ -174,7 +174,6 @@ void releaseBytes(t_bytes *bytes) { } JittedFunc createFunc(t_bytes *bytes) { - for (auto const& lbl : g_LABELS) { int nj = lbl.second.jumps.size(); for (int i = 0; i < nj; i++) {