From d9b6ab83cfc0fe0225a00e146c2d1bd59c5467a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 4 Jan 2020 21:00:15 +0100 Subject: [PATCH] Mac: MAP_32BIT is no longer supported in Catalina and breaks. We don't need it anymore anyway. Fixes #12495. --- Common/MemoryUtil.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Common/MemoryUtil.cpp b/Common/MemoryUtil.cpp index 36c7c74088..4694ef06e5 100644 --- a/Common/MemoryUtil.cpp +++ b/Common/MemoryUtil.cpp @@ -118,6 +118,10 @@ static void *SearchForFreeMem(size_t size) { // This is purposely not a full wrapper for virtualalloc/mmap, but it // provides exactly the primitive operations that PPSSPP needs. +#if PPSSPP_PLATFORM(MAC) +#undef MAP_32BIT +#endif + void *AllocateExecutableMemory(size_t size) { #if defined(_WIN32) void *ptr = nullptr; @@ -193,7 +197,7 @@ void *AllocateExecutableMemory(size_t size) { if (ptr == failed_result) { ptr = nullptr; - ERROR_LOG(MEMMAP, "Failed to allocate executable memory (%d)", (int)size); + ERROR_LOG(MEMMAP, "Failed to allocate executable memory (%d) errno=%d", (int)size, errno); PanicAlert("Failed to allocate executable memory\n%s", GetLastErrorMsg()); } #if defined(_M_X64) && !defined(_WIN32) && !defined(MAP_32BIT)