Allow using mmap for shared memory if hw bound check is disabled (#3029)

For shared memory, the max memory size must be defined in advanced. Re-allocation
for growing memory can't be used as it might change the base address, therefore when
OS_ENABLE_HW_BOUND_CHECK is enabled the memory is mmaped, and if the flag is
disabled, the memory is allocated. This change introduces a flag that allows users to use
mmap for reserving memory address space even if the OS_ENABLE_HW_BOUND_CHECK
is disabled.
This commit is contained in:
Marcin Kolny
2024-01-16 14:15:55 +00:00
committed by GitHub
parent b3aaf2abc0
commit ffa131b5ac
12 changed files with 183 additions and 112 deletions

View File

@ -80,8 +80,6 @@ typedef jmp_buf korp_jmpbuf;
#define os_longjmp longjmp
#define os_alloca alloca
#define os_getpagesize getpagesize
typedef void (*os_signal_handler)(void *sig_addr);
int
@ -101,6 +99,8 @@ os_sigreturn();
#endif /* end of BUILD_TARGET_X86_64/AMD_64/AARCH64/RISCV64 */
#endif /* end of WASM_DISABLE_HW_BOUND_CHECK */
#define os_getpagesize getpagesize
typedef long int __syscall_slong_t;
#if __ANDROID_API__ < 19