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:
@ -95,8 +95,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
|
||||
@ -116,6 +114,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
|
||||
|
||||
#if WASM_DISABLE_WAKEUP_BLOCKING_OP == 0
|
||||
#define OS_ENABLE_WAKEUP_BLOCKING_OP
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user