mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 15:49:25 +01:00
Common/MemArena: mmap returns MAP_FAILED on error, not nullptr.
This commit is contained in:
parent
a20bb3e05b
commit
c14bc6ea4c
@ -156,7 +156,7 @@ void* LazyMemoryRegion::Create(size_t size)
|
||||
ASSERT(!m_memory);
|
||||
|
||||
void* memory = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (!memory)
|
||||
if (memory == MAP_FAILED)
|
||||
{
|
||||
NOTICE_LOG_FMT(MEMMAP, "Memory allocation of {} bytes failed.", size);
|
||||
return nullptr;
|
||||
|
@ -122,7 +122,7 @@ void* LazyMemoryRegion::Create(size_t size)
|
||||
ASSERT(!m_memory);
|
||||
|
||||
void* memory = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (!memory)
|
||||
if (memory == MAP_FAILED)
|
||||
{
|
||||
NOTICE_LOG_FMT(MEMMAP, "Memory allocation of {} bytes failed.", size);
|
||||
return nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user