From a42c970a25a4c0a93459f73b7f7d264df68ba8a9 Mon Sep 17 00:00:00 2001 From: Karen Tsai Date: Wed, 14 May 2014 21:35:26 -0400 Subject: [PATCH] Fixed PPSSPP crash on iOS 5. Fixes issue #5613. --- Common/MemArena.cpp | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/Common/MemArena.cpp b/Common/MemArena.cpp index 7c5eb0713d..6dbb792728 100644 --- a/Common/MemArena.cpp +++ b/Common/MemArena.cpp @@ -34,10 +34,6 @@ #endif #endif -#ifdef IOS -void* globalbase=NULL; -#endif - #ifdef ANDROID // Hopefully this ABI will never change... @@ -249,28 +245,13 @@ u8* MemArena::Find4GBBase() } return base; #else -#ifdef IOS - void* base = NULL; - if (globalbase==NULL){ - base = mmap(0, 0x08000000, PROT_READ | PROT_WRITE, - MAP_ANON | MAP_SHARED, -1, 0); - if (base == MAP_FAILED) { - PanicAlert("Failed to map 128 MB of memory space: %s", strerror(errno)); - return 0; - } - munmap(base, 0x08000000); - globalbase=base; - } - else{base=globalbase;} -#else - void* base = mmap(0, 0x10000000, PROT_READ | PROT_WRITE, - MAP_ANON | MAP_SHARED, -1, 0); - if (base == MAP_FAILED) { - PanicAlert("Failed to map 256 MB of memory space: %s", strerror(errno)); - return 0; - } - munmap(base, 0x10000000); -#endif + void* base = mmap(0, 0x10000000, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_SHARED, -1, 0); + if (base == MAP_FAILED) { + PanicAlert("Failed to map 256 MB of memory space: %s", strerror(errno)); + return 0; + } + munmap(base, 0x10000000); return static_cast(base); #endif #endif