mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
MemMap: Check for MAP_FAILED in mmap call.
This commit is contained in:
parent
72df3fd339
commit
2b49c3e464
2 changed files with 2 additions and 2 deletions
|
@ -140,7 +140,7 @@ u8* MemArena::Find4GBBase() {
|
|||
// address by grabbing 8GB and aligning the pointer.
|
||||
const uint64_t EIGHT_GIGS = 0x200000000ULL;
|
||||
void *base = mmap(0, EIGHT_GIGS, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
|
||||
if (base) {
|
||||
if (base && base != MAP_FAILED) {
|
||||
INFO_LOG(SYSTEM, "base: %p", base);
|
||||
uint64_t aligned_base = ((uint64_t)base + 0xFFFFFFFF) & ~0xFFFFFFFFULL;
|
||||
INFO_LOG(SYSTEM, "aligned_base: %p", (void *)aligned_base);
|
||||
|
|
|
@ -109,7 +109,7 @@ u8* MemArena::Find4GBBase() {
|
|||
// address by grabbing 8GB and aligning the pointer.
|
||||
const uint64_t EIGHT_GIGS = 0x200000000ULL;
|
||||
void *base = mmap(0, EIGHT_GIGS, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
|
||||
if (base) {
|
||||
if (base && base != MAP_FAILED) {
|
||||
INFO_LOG(MEMMAP, "base: %p", base);
|
||||
uint64_t aligned_base = ((uint64_t)base + 0xFFFFFFFF) & ~0xFFFFFFFFULL;
|
||||
INFO_LOG(MEMMAP, "aligned_base: %p", (void *)aligned_base);
|
||||
|
|
Loading…
Add table
Reference in a new issue