Slightly cleanup of mmap(2) flags:
Move MAP_32BIT to MemoryUtil.h. MAP_VARIABLE is simply the absence of MAP_FIXED. Replace MAP_ANONYMOUS with the more traditional MAP_ANON - Linux is compatible. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5900 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
caeabf8bea
commit
2c419382c9
|
@ -16,12 +16,12 @@
|
|||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Common.h"
|
||||
#include "MemoryUtil.h"
|
||||
#include "MemArena.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
@ -29,10 +29,6 @@
|
|||
#include <cstring>
|
||||
#endif
|
||||
|
||||
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
|
||||
#define MAP_ANONYMOUS MAP_ANON
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
static const char* ram_temp_file = "/tmp/gc_mem.tmp";
|
||||
#endif
|
||||
|
@ -123,7 +119,8 @@ u8* MemArena::Find4GBBase()
|
|||
}
|
||||
return base;
|
||||
#else
|
||||
void* base = mmap(0, 0x31000000, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, 0, 0);
|
||||
void* base = mmap(0, 0x31000000, PROT_READ | PROT_WRITE,
|
||||
MAP_ANON | MAP_SHARED, 0, 0);
|
||||
if (base == MAP_FAILED) {
|
||||
PanicAlert("Failed to map 1 GB of memory space: %s", strerror(errno));
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue