From be3428cf8e7698e4efe9c50cd6499516e7f36332 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 10 Aug 2014 04:50:58 -0400 Subject: [PATCH] Core: Fix case where a panic alert wouldn't be shown in MemoryUtil.cpp --- Source/Core/Common/MemoryUtil.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Common/MemoryUtil.cpp b/Source/Core/Common/MemoryUtil.cpp index 3a10d031cf..7a075692ce 100644 --- a/Source/Core/Common/MemoryUtil.cpp +++ b/Source/Core/Common/MemoryUtil.cpp @@ -91,10 +91,10 @@ void* AllocateMemoryPages(size_t size) #else void* ptr = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); -#endif - // printf("Mapped memory at %p (size %ld)\n", ptr, - // (unsigned long)size); + if (ptr == MAP_FAILED) + ptr = nullptr; +#endif if (ptr == nullptr) PanicAlert("Failed to allocate raw memory");