From 684213c7af8c83a332bc679ceb84ece69f48a149 Mon Sep 17 00:00:00 2001 From: Xu Jun <693788454@qq.com> Date: Thu, 7 Jul 2022 11:20:08 +0800 Subject: [PATCH] remove unnecessary memset after mmap --- core/iwasm/aot/aot_runtime.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/iwasm/aot/aot_runtime.c b/core/iwasm/aot/aot_runtime.c index 64024ce07..3a608117e 100644 --- a/core/iwasm/aot/aot_runtime.c +++ b/core/iwasm/aot/aot_runtime.c @@ -525,7 +525,8 @@ memory_instantiate(AOTModuleInstance *module_inst, AOTModule *module, os_munmap(mapped_mem, map_size); return NULL; } - memset(p, 0, (uint32)total_size); + /* Newly allocated pages are filled with zero by the OS, we don't fill it + * again here */ #endif /* end of OS_ENABLE_HW_BOUND_CHECK */ memory_inst->module_type = Wasm_Module_AoT;