mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-27 03:39:57 +00:00
Core: Remove leftover Windows 32-bit functions in MemArena.cpp
This commit is contained in:
parent
2ff44b5a66
commit
eb10899b53
@ -141,16 +141,7 @@ u8* MemArena::Find4GBBase()
|
|||||||
return reinterpret_cast<u8*>(0x2300000000ULL);
|
return reinterpret_cast<u8*>(0x2300000000ULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else // 32 bit
|
||||||
// 32 bit
|
|
||||||
#ifdef _WIN32
|
|
||||||
// The highest thing in any 1GB section of memory space is the locked cache. We only need to fit it.
|
|
||||||
u8* base = (u8*)VirtualAlloc(0, 0x31000000, MEM_RESERVE, PAGE_READWRITE);
|
|
||||||
if (base) {
|
|
||||||
VirtualFree(base, 0, MEM_RELEASE);
|
|
||||||
}
|
|
||||||
return base;
|
|
||||||
#else
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
// Android 4.3 changed how mmap works.
|
// Android 4.3 changed how mmap works.
|
||||||
// if we map it private and then munmap it, we can't use the base returned.
|
// if we map it private and then munmap it, we can't use the base returned.
|
||||||
@ -168,7 +159,6 @@ u8* MemArena::Find4GBBase()
|
|||||||
munmap(base, MemSize);
|
munmap(base, MemSize);
|
||||||
return static_cast<u8*>(base);
|
return static_cast<u8*>(base);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -257,23 +247,6 @@ u8 *MemoryMap_Setup(const MemoryView *views, int num_views, u32 flags, MemArena
|
|||||||
exit(0);
|
exit(0);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#ifdef _WIN32
|
|
||||||
// Try a whole range of possible bases. Return once we got a valid one.
|
|
||||||
u32 max_base_addr = 0x7FFF0000 - 0x31000000;
|
|
||||||
u8 *base = nullptr;
|
|
||||||
|
|
||||||
for (u32 base_addr = 0x40000; base_addr < max_base_addr; base_addr += 0x40000)
|
|
||||||
{
|
|
||||||
base_attempts++;
|
|
||||||
base = (u8 *)base_addr;
|
|
||||||
if (Memory_TryBase(base, views, num_views, flags, arena))
|
|
||||||
{
|
|
||||||
INFO_LOG(MEMMAP, "Found valid memory base at %p after %i tries.", base, base_attempts);
|
|
||||||
base_attempts = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
// Linux32 is fine with the x64 method, although limited to 32-bit with no automirrors.
|
// Linux32 is fine with the x64 method, although limited to 32-bit with no automirrors.
|
||||||
u8 *base = MemArena::Find4GBBase();
|
u8 *base = MemArena::Find4GBBase();
|
||||||
@ -285,7 +258,6 @@ u8 *MemoryMap_Setup(const MemoryView *views, int num_views, u32 flags, MemArena
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
if (base_attempts)
|
if (base_attempts)
|
||||||
PanicAlert("No possible memory base pointer found!");
|
PanicAlert("No possible memory base pointer found!");
|
||||||
return base;
|
return base;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user