diff options
| author | 2018-09-15 15:21:06 +0200 | |
|---|---|---|
| committer | 2018-09-15 15:21:06 +0200 | |
| commit | 63c2e32e207d31ecadd9022e1d7cd705c9febac8 (patch) | |
| tree | 8a90e8ef2804f147dff7225a543a8740ecf7160c /src/common/memory_util.cpp | |
| parent | Merge pull request #1310 from lioncash/kernel-ns (diff) | |
| download | yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.tar.gz yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.tar.xz yuzu-63c2e32e207d31ecadd9022e1d7cd705c9febac8.zip | |
Port #4182 from Citra: "Prefix all size_t with std::"
Diffstat (limited to '')
| -rw-r--r-- | src/common/memory_util.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp index 09462ccee..9736fb12a 100644 --- a/src/common/memory_util.cpp +++ b/src/common/memory_util.cpp | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | // This is purposely not a full wrapper for virtualalloc/mmap, but it | 25 | // This is purposely not a full wrapper for virtualalloc/mmap, but it |
| 26 | // provides exactly the primitive operations that Dolphin needs. | 26 | // provides exactly the primitive operations that Dolphin needs. |
| 27 | 27 | ||
| 28 | void* AllocateExecutableMemory(size_t size, bool low) { | 28 | void* AllocateExecutableMemory(std::size_t size, bool low) { |
| 29 | #if defined(_WIN32) | 29 | #if defined(_WIN32) |
| 30 | void* ptr = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); | 30 | void* ptr = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); |
| 31 | #else | 31 | #else |
| @@ -74,7 +74,7 @@ void* AllocateExecutableMemory(size_t size, bool low) { | |||
| 74 | return ptr; | 74 | return ptr; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | void* AllocateMemoryPages(size_t size) { | 77 | void* AllocateMemoryPages(std::size_t size) { |
| 78 | #ifdef _WIN32 | 78 | #ifdef _WIN32 |
| 79 | void* ptr = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE); | 79 | void* ptr = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE); |
| 80 | #else | 80 | #else |
| @@ -90,7 +90,7 @@ void* AllocateMemoryPages(size_t size) { | |||
| 90 | return ptr; | 90 | return ptr; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | void* AllocateAlignedMemory(size_t size, size_t alignment) { | 93 | void* AllocateAlignedMemory(std::size_t size, std::size_t alignment) { |
| 94 | #ifdef _WIN32 | 94 | #ifdef _WIN32 |
| 95 | void* ptr = _aligned_malloc(size, alignment); | 95 | void* ptr = _aligned_malloc(size, alignment); |
| 96 | #else | 96 | #else |
| @@ -109,7 +109,7 @@ void* AllocateAlignedMemory(size_t size, size_t alignment) { | |||
| 109 | return ptr; | 109 | return ptr; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | void FreeMemoryPages(void* ptr, size_t size) { | 112 | void FreeMemoryPages(void* ptr, std::size_t size) { |
| 113 | if (ptr) { | 113 | if (ptr) { |
| 114 | #ifdef _WIN32 | 114 | #ifdef _WIN32 |
| 115 | if (!VirtualFree(ptr, 0, MEM_RELEASE)) | 115 | if (!VirtualFree(ptr, 0, MEM_RELEASE)) |
| @@ -130,7 +130,7 @@ void FreeAlignedMemory(void* ptr) { | |||
| 130 | } | 130 | } |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | void WriteProtectMemory(void* ptr, size_t size, bool allowExecute) { | 133 | void WriteProtectMemory(void* ptr, std::size_t size, bool allowExecute) { |
| 134 | #ifdef _WIN32 | 134 | #ifdef _WIN32 |
| 135 | DWORD oldValue; | 135 | DWORD oldValue; |
| 136 | if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READ : PAGE_READONLY, &oldValue)) | 136 | if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READ : PAGE_READONLY, &oldValue)) |
| @@ -140,7 +140,7 @@ void WriteProtectMemory(void* ptr, size_t size, bool allowExecute) { | |||
| 140 | #endif | 140 | #endif |
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute) { | 143 | void UnWriteProtectMemory(void* ptr, std::size_t size, bool allowExecute) { |
| 144 | #ifdef _WIN32 | 144 | #ifdef _WIN32 |
| 145 | DWORD oldValue; | 145 | DWORD oldValue; |
| 146 | if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, | 146 | if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, |