Fixed the use of __buildin___clear_cache()

This commit is contained in:
kobalicek
2020-12-10 01:21:16 +01:00
parent 4b13f71314
commit 3b886c8b7b

View File

@@ -42,8 +42,8 @@ static inline void JitRuntime_flushInstructionCache(const void* p, size_t size)
// Windows has a built-in support in `kernel32.dll`. // Windows has a built-in support in `kernel32.dll`.
::FlushInstructionCache(::GetCurrentProcess(), p, size); ::FlushInstructionCache(::GetCurrentProcess(), p, size);
# elif defined(__GNUC__) # elif defined(__GNUC__)
void* start = const_cast<void*>(p); char* start = static_cast<char*>(const_cast<void*>(p));
void* end = static_cast<uint8_t*>(start) + size; char* end = start + size;
__builtin___clear_cache(start, end); __builtin___clear_cache(start, end);
# else # else
DebugUtils::unused(p, size); DebugUtils::unused(p, size);