Implement memory access bound check with hardware trap for 64-bit platforms (#293)

Also implement native stack overflow check with hardware trap for 64-bit platforms
Refine classic interpreter and fast interpreter to improve performance
Update document
This commit is contained in:
wenyongh
2020-06-28 15:41:25 +08:00
committed by GitHub
parent 548926ab1a
commit ee315e4049
33 changed files with 1143 additions and 438 deletions

View File

@ -110,16 +110,18 @@ os_vprintf(const char *fmt, va_list ap)
}
void *
os_mmap(void *hint, unsigned int size, int prot, int flags)
os_mmap(void *hint, size_t size, int prot, int flags)
{
if ((uint64)size >= UINT32_MAX)
return NULL;
if (exec_mem_alloc_func)
return exec_mem_alloc_func(size);
return exec_mem_alloc_func((uint32)size);
else
return BH_MALLOC(size);
}
void
os_munmap(void *addr, uint32 size)
os_munmap(void *addr, size_t size)
{
if (exec_mem_free_func)
exec_mem_free_func(addr);
@ -128,7 +130,7 @@ os_munmap(void *addr, uint32 size)
}
int
os_mprotect(void *addr, uint32 size, int prot)
os_mprotect(void *addr, size_t size, int prot)
{
return 0;
}