Enable merged os_mmap for aot data sections and aot text (#3743)

Enable merged os_mmap for aot data sections first, and try enabling merged
os_mmap for them and aot text except on platform nuttx and esp-idf.

This fixes the issue that aarch64 AOT module fails to load on android:
https://github.com/bytecodealliance/wasm-micro-runtime/issues/2274

And also refine os_mmap related code.
This commit is contained in:
Wenyong Huang
2024-08-21 12:55:34 +08:00
committed by GitHub
parent 1329e1d3e1
commit 67dce48201
2 changed files with 178 additions and 72 deletions

View File

@ -315,6 +315,13 @@ typedef struct AOTModule {
/* Whether the underlying wasm binary buffer can be freed */
bool is_binary_freeable;
/* `.data` sections merged into one mmaped to reduce the tlb cache miss */
uint8 *merged_data_sections;
uint32 merged_data_sections_size;
/* `.data` and `.text` sections merged into one large mmaped section */
uint8 *merged_data_text_sections;
uint32 merged_data_text_sections_size;
} AOTModule;
#define AOTMemoryInstance WASMMemoryInstance