diff options
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 bab7d9f7a..b6f66e4e1 100644 --- a/src/common/memory_util.cpp +++ b/src/common/memory_util.cpp | |||
| @@ -47,7 +47,7 @@ void* AllocateExecutableMemory(size_t size, bool low) | |||
| 47 | 47 | ||
| 48 | // printf("Mapped executable memory at %p (size %ld)\n", ptr, | 48 | // printf("Mapped executable memory at %p (size %ld)\n", ptr, |
| 49 | // (unsigned long)size); | 49 | // (unsigned long)size); |
| 50 | 50 | ||
| 51 | #ifdef _WIN32 | 51 | #ifdef _WIN32 |
| 52 | if (ptr == nullptr) | 52 | if (ptr == nullptr) |
| 53 | { | 53 | { |
| @@ -55,7 +55,7 @@ void* AllocateExecutableMemory(size_t size, bool low) | |||
| 55 | if (ptr == MAP_FAILED) | 55 | if (ptr == MAP_FAILED) |
| 56 | { | 56 | { |
| 57 | ptr = nullptr; | 57 | ptr = nullptr; |
| 58 | #endif | 58 | #endif |
| 59 | PanicAlert("Failed to allocate executable memory"); | 59 | PanicAlert("Failed to allocate executable memory"); |
| 60 | } | 60 | } |
| 61 | #if !defined(_WIN32) && defined(__x86_64__) && !defined(MAP_32BIT) | 61 | #if !defined(_WIN32) && defined(__x86_64__) && !defined(MAP_32BIT) |
| @@ -127,11 +127,11 @@ void FreeMemoryPages(void* ptr, size_t size) | |||
| 127 | if (ptr) | 127 | if (ptr) |
| 128 | { | 128 | { |
| 129 | #ifdef _WIN32 | 129 | #ifdef _WIN32 |
| 130 | 130 | ||
| 131 | if (!VirtualFree(ptr, 0, MEM_RELEASE)) | 131 | if (!VirtualFree(ptr, 0, MEM_RELEASE)) |
| 132 | PanicAlert("FreeMemoryPages failed!\n%s", GetLastErrorMsg()); | 132 | PanicAlert("FreeMemoryPages failed!\n%s", GetLastErrorMsg()); |
| 133 | ptr = NULL; // Is this our responsibility? | 133 | ptr = NULL; // Is this our responsibility? |
| 134 | 134 | ||
| 135 | #else | 135 | #else |
| 136 | munmap(ptr, size); | 136 | munmap(ptr, size); |
| 137 | #endif | 137 | #endif |