diff --git a/Source/Core/Common/MemArenaAndroid.cpp b/Source/Core/Common/MemArenaAndroid.cpp index 45b685274b..3c4b800da8 100644 --- a/Source/Core/Common/MemArenaAndroid.cpp +++ b/Source/Core/Common/MemArenaAndroid.cpp @@ -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; diff --git a/Source/Core/Common/MemArenaUnix.cpp b/Source/Core/Common/MemArenaUnix.cpp index f962da755a..ef359de908 100644 --- a/Source/Core/Common/MemArenaUnix.cpp +++ b/Source/Core/Common/MemArenaUnix.cpp @@ -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;