Common/MemArena: Assert return value of LazyMemoryRegion::Clear()'s mmap() call.

This commit is contained in:
Admiral H. Curtiss 2023-09-07 04:00:22 +02:00
parent c0440df288
commit a20bb3e05b
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
2 changed files with 6 additions and 2 deletions

View File

@ -172,7 +172,9 @@ void LazyMemoryRegion::Clear()
{
ASSERT(m_memory);
mmap(m_memory, m_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
void* new_memory = mmap(m_memory, m_size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
ASSERT(new_memory == m_memory);
}
void LazyMemoryRegion::Release()

View File

@ -138,7 +138,9 @@ void LazyMemoryRegion::Clear()
{
ASSERT(m_memory);
mmap(m_memory, m_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
void* new_memory = mmap(m_memory, m_size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
ASSERT(new_memory == m_memory);
}
void LazyMemoryRegion::Release()