core/shared/platform: Zero memory returned by os_mmap in some platforms (#3551)
The os_mmap should zero the mapped memory like what posix mmap does.
This commit is contained in:
@ -200,7 +200,12 @@ os_cond_wait(korp_cond *cond, korp_mutex *mutex)
|
||||
void *
|
||||
os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
|
||||
{
|
||||
return rt_malloc(size);
|
||||
void *addr;
|
||||
|
||||
if ((addr = rt_malloc(size)))
|
||||
memset(addr, 0, size);
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
void
|
||||
@ -221,4 +226,4 @@ os_dcache_flush(void)
|
||||
|
||||
void
|
||||
os_icache_flush(void *start, size_t len)
|
||||
{}
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user