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.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp
index 5ef784224..b299b0f0f 100644
--- a/src/common/memory_util.cpp
+++ b/src/common/memory_util.cpp
@@ -28,9 +28,9 @@
28void* AllocateExecutableMemory(size_t size, bool low) 28void* AllocateExecutableMemory(size_t size, bool low)
29{ 29{
30#if defined(_WIN32) 30#if defined(_WIN32)
31 void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); 31 void* ptr = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
32#else 32#else
33 static char *map_hint = 0; 33 static char* map_hint = nullptr;
34#if defined(ARCHITECTURE_X64) && !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
@@ -85,9 +85,9 @@ void* AllocateExecutableMemory(size_t size, bool low)
85void* AllocateMemoryPages(size_t size) 85void* AllocateMemoryPages(size_t size)
86{ 86{
87#ifdef _WIN32 87#ifdef _WIN32
88 void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE); 88 void* ptr = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE);
89#else 89#else
90 void* ptr = mmap(0, size, PROT_READ | PROT_WRITE, 90 void* ptr = mmap(nullptr, size, PROT_READ | PROT_WRITE,
91 MAP_ANON | MAP_PRIVATE, -1, 0); 91 MAP_ANON | MAP_PRIVATE, -1, 0);
92 92
93 if (ptr == MAP_FAILED) 93 if (ptr == MAP_FAILED)