Always allocate linear memory using mmap (#3052)

With this approach we can omit using memset() for the newly allocated memory
therefore the physical pages are not being used unless touched by the program.

This also simplifies the implementation.
This commit is contained in:
Marcin Kolny
2024-02-02 14:17:44 +00:00
committed by GitHub
parent 2eb60060d8
commit a27ddece7f
25 changed files with 384 additions and 425 deletions

View File

@ -176,3 +176,10 @@ else()
OUTPUT_VARIABLE cmdOutput
)
endif()
if (WAMR_BUILD_SPEC_TEST EQUAL 1)
execute_process(
COMMAND bash -c "sed -i -E 's/<ReservedMemMaxSize>0x1000000<\\/ReservedMemMaxSize>/<ReservedMemMaxSize>0x8000000<\\/ReservedMemMaxSize>/g' ${CMAKE_CURRENT_SOURCE_DIR}/enclave-sample/Enclave/Enclave.config.xml"
OUTPUT_VARIABLE cmdOutput
)
endif()

View File

@ -391,6 +391,7 @@ CSRCS += nuttx_platform.c \
posix_thread.c \
posix_time.c \
posix_sleep.c \
mremap.c \
mem_alloc.c \
ems_kfc.c \
ems_alloc.c \
@ -401,6 +402,7 @@ CSRCS += nuttx_platform.c \
bh_hashmap.c \
bh_list.c \
bh_log.c \
bh_memutils.c \
bh_queue.c \
bh_vector.c \
bh_read_file.c \
@ -416,6 +418,7 @@ CSRCS += nuttx_platform.c \
ASRCS += $(INVOKE_NATIVE)
VPATH += $(SHARED_ROOT)/platform/nuttx
VPATH += $(SHARED_ROOT)/platform/common/memory
VPATH += $(SHARED_ROOT)/platform/common/posix
VPATH += $(SHARED_ROOT)/platform/common/libc-util
VPATH += $(SHARED_ROOT)/mem-alloc