Remove unnecessary memset after mmap (#1273)

Remove unnecessary memset after mmap to decrease the number of
page faults, as reported in #1269.
This commit is contained in:
Xu Jun 2022-07-07 13:53:50 +08:00 committed by GitHub
parent be8ba9e1fd
commit db210fbc66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;