Blame SOURCES/remove-setrlimit-on-freebsd.patch

006bc1
commit 320b751a3ec8c2495503ec0b9270f61e3459283a
006bc1
Author: myfreeweb <greg@unrelenting.technology>
006bc1
Date:   Mon May 20 21:53:04 2019 +0300
006bc1
006bc1
    Remove setrlimit on FreeBSD
006bc1
    
006bc1
    An embeddable interpreter setting a limit that's inherited by spawned child processes is a disaster.. (in fact, the weird limit in Neovim's terminal was what caused me to discover this.)
006bc1
    
006bc1
    This code is a relic from the FreeBSD <10 days, and the check for FreeBSD version was not correct (__FreeBSD_kernel__ is defined anyway on newer versions). Let's just get rid of this.
006bc1
006bc1
diff --git a/src/lj_alloc.c b/src/lj_alloc.c
006bc1
index 33a2eb8f..73913011 100644
006bc1
--- a/src/lj_alloc.c
006bc1
+++ b/src/lj_alloc.c
006bc1
@@ -344,20 +344,6 @@ static void *CALL_MMAP(size_t size)
006bc1
 }
006bc1
 #endif
006bc1
 
006bc1
-#if LJ_64 && !LJ_GC64 && ((defined(__FreeBSD__) && __FreeBSD__ < 10) || defined(__FreeBSD_kernel__)) && !LJ_TARGET_PS4
006bc1
-
006bc1
-#include <sys/resource.h>
006bc1
-
006bc1
-static void init_mmap(void)
006bc1
-{
006bc1
-  struct rlimit rlim;
006bc1
-  rlim.rlim_cur = rlim.rlim_max = 0x10000;
006bc1
-  setrlimit(RLIMIT_DATA, &rlim);  /* Ignore result. May fail later. */
006bc1
-}
006bc1
-#define INIT_MMAP()	init_mmap()
006bc1
-
006bc1
-#endif
006bc1
-
006bc1
 static int CALL_MUNMAP(void *ptr, size_t size)
006bc1
 {
006bc1
   int olderr = errno;