diff options
| author | 2015-08-15 18:26:12 -0400 | |
|---|---|---|
| committer | 2015-08-15 18:26:12 -0400 | |
| commit | d852c4ecc71f800b552978362947a5eb5a524694 (patch) | |
| tree | 9ea9a86da4027126914e69b12c24d2849fdb2c2d /src/common/memory_util.cpp | |
| parent | Merge pull request #1027 from lioncash/debugger (diff) | |
| parent | Shader: Use a POD struct for registers. (diff) | |
| download | yuzu-d852c4ecc71f800b552978362947a5eb5a524694.tar.gz yuzu-d852c4ecc71f800b552978362947a5eb5a524694.tar.xz yuzu-d852c4ecc71f800b552978362947a5eb5a524694.zip | |
Merge pull request #1002 from bunnei/shader-jit
Vertex Shader JIT for X86-64
Diffstat (limited to 'src/common/memory_util.cpp')
| -rw-r--r-- | src/common/memory_util.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp index 2b3ace528..5ef784224 100644 --- a/src/common/memory_util.cpp +++ b/src/common/memory_util.cpp | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #include <sys/mman.h> | 16 | #include <sys/mman.h> |
| 17 | #endif | 17 | #endif |
| 18 | 18 | ||
| 19 | #if !defined(_WIN32) && defined(__x86_64__) && !defined(MAP_32BIT) | 19 | #if !defined(_WIN32) && defined(ARCHITECTURE_X64) && !defined(MAP_32BIT) |
| 20 | #include <unistd.h> | 20 | #include <unistd.h> |
| 21 | #define PAGE_MASK (getpagesize() - 1) | 21 | #define PAGE_MASK (getpagesize() - 1) |
| 22 | #define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK)) | 22 | #define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK)) |
| @@ -31,7 +31,7 @@ void* AllocateExecutableMemory(size_t size, bool low) | |||
| 31 | void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); | 31 | void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); |
| 32 | #else | 32 | #else |
| 33 | static char *map_hint = 0; | 33 | static char *map_hint = 0; |
| 34 | #if defined(__x86_64__) && !defined(MAP_32BIT) | 34 | #if defined(ARCHITECTURE_X64) && !defined(MAP_32BIT) |
| 35 | // This OS has no flag to enforce allocation below the 4 GB boundary, | 35 | // This OS has no flag to enforce allocation below the 4 GB boundary, |
| 36 | // but if we hint that we want a low address it is very likely we will | 36 | // but if we hint that we want a low address it is very likely we will |
| 37 | // get one. | 37 | // get one. |
| @@ -43,7 +43,7 @@ void* AllocateExecutableMemory(size_t size, bool low) | |||
| 43 | #endif | 43 | #endif |
| 44 | void* ptr = mmap(map_hint, size, PROT_READ | PROT_WRITE | PROT_EXEC, | 44 | void* ptr = mmap(map_hint, size, PROT_READ | PROT_WRITE | PROT_EXEC, |
| 45 | MAP_ANON | MAP_PRIVATE | 45 | MAP_ANON | MAP_PRIVATE |
| 46 | #if defined(__x86_64__) && defined(MAP_32BIT) | 46 | #if defined(ARCHITECTURE_X64) && defined(MAP_32BIT) |
| 47 | | (low ? MAP_32BIT : 0) | 47 | | (low ? MAP_32BIT : 0) |
| 48 | #endif | 48 | #endif |
| 49 | , -1, 0); | 49 | , -1, 0); |
| @@ -62,7 +62,7 @@ void* AllocateExecutableMemory(size_t size, bool low) | |||
| 62 | #endif | 62 | #endif |
| 63 | LOG_ERROR(Common_Memory, "Failed to allocate executable memory"); | 63 | LOG_ERROR(Common_Memory, "Failed to allocate executable memory"); |
| 64 | } | 64 | } |
| 65 | #if !defined(_WIN32) && defined(__x86_64__) && !defined(MAP_32BIT) | 65 | #if !defined(_WIN32) && defined(ARCHITECTURE_X64) && !defined(MAP_32BIT) |
| 66 | else | 66 | else |
| 67 | { | 67 | { |
| 68 | if (low) | 68 | if (low) |