mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-21 14:23:26 +00:00
Restore fallback allocator
This commit is contained in:
parent
91bc6b8ad1
commit
1244b6b4b6
@ -124,10 +124,34 @@ static int mcode_setprot(void *p, size_t sz, int prot)
|
||||
return mprotect(p, sz, prot);
|
||||
}
|
||||
|
||||
#else
|
||||
#elif LJ_64 || LUAJIT_SECURITY_MCODE
|
||||
|
||||
#error "Missing OS support for explicit placement of executable memory"
|
||||
|
||||
#else
|
||||
|
||||
/* Fallback allocator. This will fail if memory is not executable by default. */
|
||||
#define MCPROT_RW 0
|
||||
#define MCPROT_RX 0
|
||||
#define MCPROT_RWX 0
|
||||
|
||||
static void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, int prot)
|
||||
{
|
||||
UNUSED(hint); UNUSED(prot);
|
||||
return lj_mem_new(J->L, sz);
|
||||
}
|
||||
|
||||
static void mcode_free(jit_State *J, void *p, size_t sz)
|
||||
{
|
||||
lj_mem_free(J2G(J), p, sz);
|
||||
}
|
||||
|
||||
static int mcode_setprot(void *p, size_t sz, int prot)
|
||||
{
|
||||
UNUSED(p); UNUSED(sz); UNUSED(prot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* -- MCode area protection ----------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user