mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-19 21:43:27 +00:00
Address comment about clearing instruction cache
This commit is contained in:
parent
9c7dbda52a
commit
d708f6f7bf
@ -29,6 +29,11 @@
|
||||
#include <valgrind/valgrind.h>
|
||||
#endif
|
||||
|
||||
#if LJ_TARGET_WINDOWS
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if LJ_TARGET_IOS
|
||||
void sys_icache_invalidate(void *start, size_t len);
|
||||
#endif
|
||||
@ -39,7 +44,9 @@ void lj_mcode_sync(void *start, void *end)
|
||||
#ifdef LUAJIT_USE_VALGRIND
|
||||
VALGRIND_DISCARD_TRANSLATIONS(start, (char *)end-(char *)start);
|
||||
#endif
|
||||
#if LJ_TARGET_X86ORX64 || _MSC_VER
|
||||
#if LJ_TARGET_WINDOWS
|
||||
FlushInstructionCache(GetCurrentProcess(), start, (char *)end-(char *)start);
|
||||
#elif LJ_TARGET_X86ORX64
|
||||
UNUSED(start); UNUSED(end);
|
||||
#elif LJ_TARGET_IOS
|
||||
sys_icache_invalidate(start, (char *)end-(char *)start);
|
||||
@ -58,9 +65,6 @@ void lj_mcode_sync(void *start, void *end)
|
||||
|
||||
#if LJ_TARGET_WINDOWS
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#define MCPROT_RW PAGE_READWRITE
|
||||
#define MCPROT_RX PAGE_EXECUTE_READ
|
||||
#define MCPROT_RWX PAGE_EXECUTE_READWRITE
|
||||
|
Loading…
Reference in New Issue
Block a user