From 92c011b5117f237f2554c5745646ea566ce0d568 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 5 May 2020 12:32:55 +0200 Subject: Windows: Make actual use of internal allocator optimization. Thanks to Nicholas Ham. --- src/lj_alloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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) } /* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ -static void *DIRECT_MMAP(size_t size) +static void *direct_mmap(size_t size) { DWORD olderr = GetLastError(); void *ptr = NULL; @@ -173,7 +173,7 @@ static void *CALL_MMAP(size_t size) } /* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ -static void *DIRECT_MMAP(size_t size) +static void *direct_mmap(size_t size) { DWORD olderr = GetLastError(); 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) #endif +#define DIRECT_MMAP(size) direct_mmap(size) + /* This function supports releasing coalesed segments */ static int CALL_MUNMAP(void *ptr, size_t size) { -- cgit v1.2.3-55-g6feb