aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lj_alloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_alloc.c b/src/lj_alloc.c
index f3b6a54d..33a2eb8f 100644
--- a/src/lj_alloc.c
+++ b/src/lj_alloc.c
@@ -255,7 +255,8 @@ static void *mmap_probe(size_t size)
255 for (retry = 0; retry < LJ_ALLOC_MMAP_PROBE_MAX; retry++) { 255 for (retry = 0; retry < LJ_ALLOC_MMAP_PROBE_MAX; retry++) {
256 void *p = mmap((void *)hint_addr, size, MMAP_PROT, MMAP_FLAGS_PROBE, -1, 0); 256 void *p = mmap((void *)hint_addr, size, MMAP_PROT, MMAP_FLAGS_PROBE, -1, 0);
257 uintptr_t addr = (uintptr_t)p; 257 uintptr_t addr = (uintptr_t)p;
258 if ((addr >> LJ_ALLOC_MBITS) == 0 && addr >= LJ_ALLOC_MMAP_PROBE_LOWER) { 258 if ((addr >> LJ_ALLOC_MBITS) == 0 && addr >= LJ_ALLOC_MMAP_PROBE_LOWER &&
259 ((addr + size) >> LJ_ALLOC_MBITS) == 0) {
259 /* We got a suitable address. Bump the hint address. */ 260 /* We got a suitable address. Bump the hint address. */
260 hint_addr = addr + size; 261 hint_addr = addr + size;
261 errno = olderr; 262 errno = olderr;