Skip to content

Commit 77b6225

Browse files
committed
fix alpine compilation with prctl.h (issue microsoft#1059)
1 parent e1110cd commit 77b6225

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/prim/unix/prim.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ terms of the MIT license. A copy of the license can be found in the file
3131

3232
#if defined(__linux__)
3333
#include <features.h>
34-
#include <linux/prctl.h> // PR_SET_VMA
35-
//#if defined(MI_NO_THP)
36-
#include <sys/prctl.h> // THP disable
37-
//#endif
34+
#include <sys/prctl.h> // THP disable, PR_SET_VMA
3835
#if defined(__GLIBC__)
3936
#include <linux/mman.h> // linux mmap flags
4037
#else
@@ -208,7 +205,7 @@ static int unix_madvise(void* addr, size_t size, int advice) {
208205

209206
static void* unix_mmap_prim(void* addr, size_t size, int protect_flags, int flags, int fd) {
210207
void* p = mmap(addr, size, protect_flags, flags, fd, 0 /* offset */);
211-
#if (defined(__linux__) && defined(PR_SET_VMA))
208+
#if defined(__linux__) && defined(PR_SET_VMA)
212209
if (p!=MAP_FAILED && p!=NULL) {
213210
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, p, size, "mimalloc");
214211
}

0 commit comments

Comments
 (0)