mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Allocate low executable memory on OS X as on Windows and Linux.
Even with LoadStorePaired accounted for, there are still some niggling 64-bit cleanliness bugs left that are not practical to weed out on a single platform. We should probably have an option to use >2GB memory only on all platforms for debugging. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6792 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -58,19 +58,12 @@ void MemArena::ReleaseSpace()
|
||||
}
|
||||
|
||||
|
||||
void* MemArena::CreateView(s64 offset, size_t size, bool ensure_low_mem)
|
||||
void* MemArena::CreateView(s64 offset, size_t size)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return MapViewOfFile(hMemoryMapping, FILE_MAP_ALL_ACCESS, 0, (DWORD)((u64)offset), size);
|
||||
#else
|
||||
void* ptr = mmap(0, size,
|
||||
PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED
|
||||
#ifdef __x86_64__
|
||||
| (ensure_low_mem ? MAP_32BIT : 0)
|
||||
#endif
|
||||
, fd, offset);
|
||||
return ptr;
|
||||
return mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user