diff options
author | Mike Pall <mike> | 2020-05-05 12:32:55 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2020-05-05 12:32:55 +0200 |
commit | 92c011b5117f237f2554c5745646ea566ce0d568 (patch) | |
tree | 4a55c53f1b2396b7986b9a0f7c9d8f94e6ce4de0 /src | |
parent | 99d1268823914d0c1f46df0e85bf8fce50292252 (diff) | |
download | luajit-92c011b5117f237f2554c5745646ea566ce0d568.tar.gz luajit-92c011b5117f237f2554c5745646ea566ce0d568.tar.bz2 luajit-92c011b5117f237f2554c5745646ea566ce0d568.zip |
Windows: Make actual use of internal allocator optimization.
Thanks to Nicholas Ham.
Diffstat (limited to '')
-rw-r--r-- | src/lj_alloc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_alloc.c b/src/lj_alloc.c index 33a2eb8f..a12ec8b4 100644 --- a/src/lj_alloc.c +++ b/src/lj_alloc.c | |||
@@ -151,7 +151,7 @@ static void *CALL_MMAP(size_t size) | |||
151 | } | 151 | } |
152 | 152 | ||
153 | /* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ | 153 | /* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ |
154 | static void *DIRECT_MMAP(size_t size) | 154 | static void *direct_mmap(size_t size) |
155 | { | 155 | { |
156 | DWORD olderr = GetLastError(); | 156 | DWORD olderr = GetLastError(); |
157 | void *ptr = NULL; | 157 | void *ptr = NULL; |
@@ -173,7 +173,7 @@ static void *CALL_MMAP(size_t size) | |||
173 | } | 173 | } |
174 | 174 | ||
175 | /* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ | 175 | /* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ |
176 | static void *DIRECT_MMAP(size_t size) | 176 | static void *direct_mmap(size_t size) |
177 | { | 177 | { |
178 | DWORD olderr = GetLastError(); | 178 | DWORD olderr = GetLastError(); |
179 | void *ptr = LJ_WIN_VALLOC(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, | 179 | void *ptr = LJ_WIN_VALLOC(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, |
@@ -184,6 +184,8 @@ static void *DIRECT_MMAP(size_t size) | |||
184 | 184 | ||
185 | #endif | 185 | #endif |
186 | 186 | ||
187 | #define DIRECT_MMAP(size) direct_mmap(size) | ||
188 | |||
187 | /* This function supports releasing coalesed segments */ | 189 | /* This function supports releasing coalesed segments */ |
188 | static int CALL_MUNMAP(void *ptr, size_t size) | 190 | static int CALL_MUNMAP(void *ptr, size_t size) |
189 | { | 191 | { |