diff --git a/ggml-alloc.c b/ggml-alloc.c index d744282f5eb4c..3265f62ec3cb4 100644 --- a/ggml-alloc.c +++ b/ggml-alloc.c @@ -1,3 +1,8 @@ +// defines MAP_ANONYMOUS +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + #include "ggml-alloc.h" #include "ggml.h" #include @@ -9,11 +14,9 @@ #if __has_include() #include #if defined(_POSIX_MAPPED_FILES) + #include #include #endif - #if defined(_POSIX_MEMLOCK_RANGE) - #include - #endif #endif #endif @@ -313,7 +316,7 @@ static void * alloc_vmem(size_t size) { #ifdef _WIN32 return VirtualAlloc(NULL, size, MEM_RESERVE, PAGE_NOACCESS); #else - return mmap(NULL, size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + return mmap(NULL, size, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0); #endif }