summaryrefslogtreecommitdiff
path: root/src/lj_alloc.c
diff options
context:
space:
mode:
authorMike Pall <mike>2014-10-07 16:17:29 +0200
committerMike Pall <mike>2014-10-07 16:17:29 +0200
commit4846a714a9b8e01bac8f9fc1de0eb2a5f00ea79b (patch)
tree8ec2daae67277bddbafc0c8e3b71a691cb48baba /src/lj_alloc.c
parentcb886b58176dc5cd969f512d1a633f06d7120941 (diff)
downloadluajit2-4846a714a9b8e01bac8f9fc1de0eb2a5f00ea79b.tar.gz
Fix DragonFly build (unsupported).
Thanks to Robin Hahling, Alex Hornung and Joris Giovannangeli.
Diffstat (limited to 'src/lj_alloc.c')
-rw-r--r--src/lj_alloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lj_alloc.c b/src/lj_alloc.c
index facccee5..7c7ec678 100644
--- a/src/lj_alloc.c
+++ b/src/lj_alloc.c
@@ -194,14 +194,14 @@ static LJ_AINLINE void *CALL_MMAP(size_t size)
return ptr;
}
-#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun__)
+#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__)
/* OSX and FreeBSD mmap() use a naive first-fit linear search.
** That's perfect for us. Except that -pagezero_size must be set for OSX,
** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs
** to be reduced to 250MB on FreeBSD.
*/
-#if LJ_TARGET_OSX
+#if LJ_TARGET_OSX || defined(__DragonFly__)
#define MMAP_REGION_START ((uintptr_t)0x10000)
#elif LJ_TARGET_PS4
#define MMAP_REGION_START ((uintptr_t)0x4000)
@@ -238,7 +238,7 @@ static LJ_AINLINE void *CALL_MMAP(size_t size)
return p;
}
if (p != CMFAIL) munmap(p, size);
-#ifdef __sun__
+#if defined(__sun__) || defined(__DragonFly__)
alloc_hint += 0x1000000; /* Need near-exhaustive linear scan. */
if (alloc_hint + size < MMAP_REGION_END) continue;
#endif