File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -362,7 +362,7 @@ void std_aligned_free(void* ptr) {
362362// / aligned_large_pages_alloc() will return suitably aligned memory, if possible using large pages.
363363
364364#if defined(_WIN32)
365-
365+ # if defined(_WIN64)
366366static void * aligned_large_pages_alloc_win (size_t allocSize) {
367367
368368 HANDLE hProcessToken { };
@@ -407,15 +407,20 @@ static void* aligned_large_pages_alloc_win(size_t allocSize) {
407407
408408 return mem;
409409}
410+ #endif
410411
411412void * aligned_large_pages_alloc (size_t allocSize) {
412413
414+ #if defined(_WIN64)
413415 // Try to allocate large pages
414416 void * mem = aligned_large_pages_alloc_win (allocSize);
415417
416418 // Fall back to regular, page aligned, allocation if necessary
417419 if (!mem)
418420 mem = VirtualAlloc (NULL , allocSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
421+ #else
422+ void * mem = VirtualAlloc (NULL , allocSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
423+ #endif
419424
420425 return mem;
421426}
You can’t perform that action at this time.
0 commit comments