Skip to content

Commit 92c011b

Browse files
author
Mike Pall
committed
Windows: Make actual use of internal allocator optimization.
Thanks to Nicholas Ham.
1 parent 99d1268 commit 92c011b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lj_alloc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static void *CALL_MMAP(size_t size)
151151
}
152152

153153
/* 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)
155155
{
156156
DWORD olderr = GetLastError();
157157
void *ptr = NULL;
@@ -173,7 +173,7 @@ static void *CALL_MMAP(size_t size)
173173
}
174174

175175
/* 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)
177177
{
178178
DWORD olderr = GetLastError();
179179
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)
184184

185185
#endif
186186

187+
#define DIRECT_MMAP(size) direct_mmap(size)
188+
187189
/* This function supports releasing coalesed segments */
188190
static int CALL_MUNMAP(void *ptr, size_t size)
189191
{

0 commit comments

Comments
 (0)