diff options
Diffstat (limited to 'src/lj_mcode.c')
-rw-r--r-- | src/lj_mcode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lj_mcode.c b/src/lj_mcode.c index e46e3ef0..64b0ca90 100644 --- a/src/lj_mcode.c +++ b/src/lj_mcode.c | |||
@@ -66,8 +66,8 @@ void lj_mcode_sync(void *start, void *end) | |||
66 | 66 | ||
67 | static void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, DWORD prot) | 67 | static void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, DWORD prot) |
68 | { | 68 | { |
69 | void *p = VirtualAlloc((void *)hint, sz, | 69 | void *p = LJ_WIN_VALLOC((void *)hint, sz, |
70 | MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, prot); | 70 | MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, prot); |
71 | if (!p && !hint) | 71 | if (!p && !hint) |
72 | lj_trace_err(J, LJ_TRERR_MCODEAL); | 72 | lj_trace_err(J, LJ_TRERR_MCODEAL); |
73 | return p; | 73 | return p; |
@@ -82,7 +82,7 @@ static void mcode_free(jit_State *J, void *p, size_t sz) | |||
82 | static int mcode_setprot(void *p, size_t sz, DWORD prot) | 82 | static int mcode_setprot(void *p, size_t sz, DWORD prot) |
83 | { | 83 | { |
84 | DWORD oprot; | 84 | DWORD oprot; |
85 | return !VirtualProtect(p, sz, prot, &oprot); | 85 | return !LJ_WIN_VPROTECT(p, sz, prot, &oprot); |
86 | } | 86 | } |
87 | 87 | ||
88 | #elif LJ_TARGET_POSIX | 88 | #elif LJ_TARGET_POSIX |
@@ -255,7 +255,7 @@ static void *mcode_alloc(jit_State *J, size_t sz) | |||
255 | /* All memory addresses are reachable by relative jumps. */ | 255 | /* All memory addresses are reachable by relative jumps. */ |
256 | static void *mcode_alloc(jit_State *J, size_t sz) | 256 | static void *mcode_alloc(jit_State *J, size_t sz) |
257 | { | 257 | { |
258 | #ifdef __OpenBSD__ | 258 | #if defined(__OpenBSD__) || LJ_TARGET_UWP |
259 | /* Allow better executable memory allocation for OpenBSD W^X mode. */ | 259 | /* Allow better executable memory allocation for OpenBSD W^X mode. */ |
260 | void *p = mcode_alloc_at(J, 0, sz, MCPROT_RUN); | 260 | void *p = mcode_alloc_at(J, 0, sz, MCPROT_RUN); |
261 | if (p && mcode_setprot(p, sz, MCPROT_GEN)) { | 261 | if (p && mcode_setprot(p, sz, MCPROT_GEN)) { |