-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Enable aligned_alloc on macOS #94298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -581,23 +581,22 @@ if(CLR_CMAKE_TARGET_IOS) | |
# Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking | ||
unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) | ||
unset(HAVE_ALIGNED_ALLOC) # only exists on iOS 13+ | ||
unset(HAVE_CLOCK_MONOTONIC) # only exists on iOS 10+ | ||
unset(HAVE_CLOCK_REALTIME) # only exists on iOS 10+ | ||
set(HAVE_CLOCK_MONOTONIC 1) | ||
set(HAVE_CLOCK_REALTIME 1) | ||
unset(HAVE_FORK) # exists but blocked by kernel | ||
elseif(CLR_CMAKE_TARGET_MACCATALYST) | ||
# Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking | ||
# TODO: test to see if these all actually hold true on Mac Catalyst | ||
unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) | ||
unset(HAVE_ALIGNED_ALLOC) # only exists on iOS 13+ | ||
unset(HAVE_CLOCK_MONOTONIC) # only exists on iOS 10+ | ||
unset(HAVE_CLOCK_REALTIME) # only exists on iOS 10+ | ||
set(HAVE_CLOCK_MONOTONIC 1) | ||
set(HAVE_CLOCK_REALTIME 1) | ||
unset(HAVE_FORK) # exists but blocked by kernel | ||
elseif(CLR_CMAKE_TARGET_TVOS) | ||
# Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking | ||
unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) | ||
unset(HAVE_ALIGNED_ALLOC) # only exists on iOS 13+ | ||
unset(HAVE_CLOCK_MONOTONIC) # only exists on iOS 10+ | ||
unset(HAVE_CLOCK_REALTIME) # only exists on iOS 10+ | ||
set(HAVE_CLOCK_MONOTONIC 1) | ||
set(HAVE_CLOCK_REALTIME 1) | ||
unset(HAVE_FORK) # exists but blocked by kernel | ||
elseif(CLR_CMAKE_TARGET_ANDROID) | ||
# Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking | ||
|
@@ -608,14 +607,10 @@ elseif(CLR_CMAKE_TARGET_ANDROID) | |
elseif(CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) | ||
set(HAVE_FORK 0) | ||
else() | ||
if(CLR_CMAKE_TARGET_OSX) | ||
unset(HAVE_ALIGNED_ALLOC) # only exists on OSX 10.15+ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our minimum supported macOS version is 10.15 so this block is no longer needed. |
||
else() | ||
check_symbol_exists( | ||
aligned_alloc | ||
stdlib.h | ||
HAVE_ALIGNED_ALLOC) | ||
endif() | ||
check_symbol_exists( | ||
aligned_alloc | ||
stdlib.h | ||
HAVE_ALIGNED_ALLOC) | ||
|
||
check_c_source_runs( | ||
" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.