From e40b001a792d7ecce8ff5b7a060ae2bc01bed8b2 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Sun, 7 Mar 2010 14:33:52 +0100 Subject: [PATCH] Improve placement of dynamically generated code on x64. --- src/lj_mcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lj_mcode.c b/src/lj_mcode.c index be3ea1c0..75e0c696 100644 --- a/src/lj_mcode.c +++ b/src/lj_mcode.c @@ -128,7 +128,7 @@ static void *mcode_alloc(jit_State *J, size_t sz, int prot) uintptr_t hint; void *p; do { - hint = LJ_PRNG_BITS(J, 15) << 16; /* 64K aligned. */ + hint = (0x78fb ^ LJ_PRNG_BITS(J, 15)) << 16; /* 64K aligned. */ } while (!(hint + sz < range && target + hint - (range>>1) < (uintptr_t)1<<47)); p = mcode_alloc_at(J, target + hint - (range>>1), sz, prot);