Skip to content

Commit

Permalink
Merge pull request #259 from SChernykh/fix_invalidate_order
Browse files Browse the repository at this point in the history
Invalidate CPU I-cache on Apple Silicon
  • Loading branch information
SChernykh authored Dec 17, 2022
2 parents 261d58c + 7245f13 commit 5bb4c77
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/virtual_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ void setPagesRX(void* ptr, size_t bytes) {
&& MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
if (__builtin_available(macOS 11.0, *)) {
pthread_jit_write_protect_np(1);
__builtin___clear_cache((char*)ptr, ((char*)ptr) + bytes);
} else {
pageProtect(ptr, bytes, PAGE_EXECUTE_READ, &errfunc);
}
Expand Down

0 comments on commit 5bb4c77

Please sign in to comment.