Extend os_mmap to support map file from fd (#2763)
Add an extra argument `os_file_handle file` for `os_mmap` to support mapping file from a file fd, and remove `os_get_invalid_handle` from `posix_file.c` and `win_file.c`, instead, add it in the `platform_internal.h` files to remove the dependency on libc-wasi. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
@ -17,8 +17,8 @@ jit_code_cache_init(uint32 code_cache_size)
|
||||
int map_prot = MMAP_PROT_READ | MMAP_PROT_WRITE | MMAP_PROT_EXEC;
|
||||
int map_flags = MMAP_MAP_NONE;
|
||||
|
||||
if (!(code_cache_pool =
|
||||
os_mmap(NULL, code_cache_size, map_prot, map_flags))) {
|
||||
if (!(code_cache_pool = os_mmap(NULL, code_cache_size, map_prot, map_flags,
|
||||
os_get_invalid_handle()))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user