From ed1af4f8262b3edaefd33dba8ff695439ce0b9db Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 15 Dec 2024 15:52:10 +0000 Subject: [PATCH] Don't use madvise() on SerenityOS SerenityOS only supports MADV_SET_VOLATILE/MADV_SET_NONVOLATILE and returns EINVAL for MADV_DONTNEED: https://github.com/SerenityOS/serenity/blob/b88cd185a0ec40fc10405b555507aa6f0aab8222/Kernel/Syscalls/mmap.cpp#L355-L388 See: https://github.com/ivmai/bdwgc/issues/688 --- os_dep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os_dep.c b/os_dep.c index 4f8ede626..24af7934e 100644 --- a/os_dep.c +++ b/os_dep.c @@ -2770,7 +2770,7 @@ block_unmap_inner(ptr_t start_addr, size_t len) # ifdef SN_TARGET_PS3 ps3_free_mem(start_addr, len); # elif defined(AIX) || defined(COSMO) || defined(CYGWIN32) \ - || defined(HPUX) || defined(SERENITY) \ + || defined(HPUX) \ || (defined(LINUX) && !defined(PREFER_MMAP_PROT_NONE)) /* On AIX, mmap(PROT_NONE) fails with ENOMEM unless the */ /* environment variable XPG_SUS_ENV is set to ON. */