summaryrefslogtreecommitdiff
path: root/src/common/memory_util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/memory_util.cpp')
-rw-r--r--src/common/memory_util.cpp12
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
28void* AllocateExecutableMemory(size_t size, bool low) { 28void* 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
77void* AllocateMemoryPages(size_t size) { 77void* 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
93void* AllocateAlignedMemory(size_t size, size_t alignment) { 93void* 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
112void FreeMemoryPages(void* ptr, size_t size) { 112void 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
133void WriteProtectMemory(void* ptr, size_t size, bool allowExecute) { 133void 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
143void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute) { 143void 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,