-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
macos: add BigSur support to execalloc
Apple Silicon requires that pages that will hold JIT code are marked with MAP_JIT (even if not using the hardened runtime) and that a call be made to a pthread function before writing to them, so a special exception could be made to the current thread[1]; add support for both. since the allocator keeps the metadata about chunk/block in the executable pages, all functions that modify that metadata will also need to be updated. note that since there is no need for an accurate pointer range with the apple implementation, NULL is passed for the pointers. historically, adding MAP_JIT was only recommended when the hardened runtime was being used as it adds several undocumented restrictions (like not being able to use JIT pages accross fork()) so the new codepath won't be used if running in Intel. Tested-by: @Keno Fixes: #51 [1] https://developer.apple.com/documentation/apple_silicon/porting_just-in-time_compilers_to_apple_silicon?language=objc
- Loading branch information
Showing
1 changed file
with
63 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters