mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Changed return type of Find4GBBase() to u8*, since it really is a pointer (all callers were typecasting it to u8*).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@553 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -30,7 +30,7 @@
|
||||
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
|
||||
#define MAP_ANONYMOUS MAP_ANON
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
const char* ram_temp_file = "/tmp/gc_mem.tmp";
|
||||
|
||||
@ -106,18 +106,18 @@ void MemArena::ReleaseView(void* view, size_t size)
|
||||
}
|
||||
|
||||
|
||||
u64 MemArena::Find4GBBase()
|
||||
u8* MemArena::Find4GBBase()
|
||||
{
|
||||
#ifdef _M_X64
|
||||
#ifdef _WIN32
|
||||
// 64 bit
|
||||
u8* base = (u8*)VirtualAlloc(0, 0xE1000000, MEM_RESERVE, PAGE_READWRITE);
|
||||
VirtualFree(base, 0, MEM_RELEASE);
|
||||
return((u64)base);
|
||||
return base;
|
||||
#else
|
||||
// Very precarious - mmap cannot return an error when trying to map already used pages.
|
||||
// This makes the Windows approach above unusable on Linux, so we will simply pray...
|
||||
return(0x2300000000ULL);
|
||||
return reinterpret_cast<u8*>(0x2300000000ULL);
|
||||
#endif
|
||||
|
||||
#else
|
||||
@ -127,12 +127,12 @@ u64 MemArena::Find4GBBase()
|
||||
u8* base = (u8*)VirtualAlloc(0, 0x31000000, MEM_RESERVE, PAGE_READWRITE);
|
||||
if (base) {
|
||||
VirtualFree(base, 0, MEM_RELEASE);
|
||||
}
|
||||
return((u64)base);
|
||||
#else
|
||||
void* base = mmap(0, 0x31000000, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, 0, 0);
|
||||
munmap(base, 0x31000000);
|
||||
return reinterpret_cast<u64>(base);
|
||||
#endif
|
||||
}
|
||||
return base;
|
||||
#else
|
||||
void* base = mmap(0, 0x31000000, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, 0, 0);
|
||||
munmap(base, 0x31000000);
|
||||
return static_cast<u8*>(base);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user