vm: remove unnecessary memset() on stop

This commit is contained in:
Nekotekina 2020-11-09 17:14:37 +03:00
parent bc61835d97
commit d1988d384c
2 changed files with 3 additions and 4 deletions

View file

@ -928,7 +928,6 @@ namespace vm
if (!shm)
{
utils::memory_protect(g_base_addr + addr, size, utils::protection::no);
std::memset(g_sudo_addr + addr, 0, size);
}
else
{

View file

@ -262,7 +262,7 @@ namespace utils
}
else
{
const u64 res64 = reinterpret_cast<u64>(::mmap(reinterpret_cast<void*>(ptr64), m_size + 0xe000, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0));
const u64 res64 = reinterpret_cast<u64>(::mmap(reinterpret_cast<void*>(ptr64), m_size + 0xf000, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0));
const u64 aligned = ::align(res64, 0x10000);
const auto result = ::mmap(reinterpret_cast<void*>(aligned), m_size, +prot, MAP_SHARED | MAP_FIXED, m_file, 0);
@ -273,9 +273,9 @@ namespace utils
verify(HERE), ::munmap(reinterpret_cast<void*>(res64), aligned - res64) == 0;
}
if (aligned < res64 + 0xe000)
if (aligned < res64 + 0xf000)
{
verify(HERE), ::munmap(reinterpret_cast<void*>(aligned + m_size), (res64 + 0xe000) - (aligned)) == 0;
verify(HERE), ::munmap(reinterpret_cast<void*>(aligned + m_size), (res64 + 0xf000) - (aligned)) == 0;
}
return reinterpret_cast<u8*>(result);