Enable AOT usage on M1 mac (#2618)

This commit is contained in:
Enrico Loparco
2023-10-07 08:05:10 +00:00
committed by GitHub
parent 1ef7c1c83d
commit 3668093053
19 changed files with 105 additions and 0 deletions

View File

@ -3232,10 +3232,13 @@ aot_load_from_aot_file(const uint8 *buf, uint32 size, char *error_buf,
if (!module)
return NULL;
os_thread_jit_write_protect_np(false); /* Make memory writable */
if (!load(buf, size, module, error_buf, error_buf_size)) {
aot_unload(module);
return NULL;
}
os_thread_jit_write_protect_np(true); /* Make memory executable */
os_icache_flush(module->code, module->code_size);
LOG_VERBOSE("Load module success.\n");
return module;