-
Notifications
You must be signed in to change notification settings - Fork 824
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
LLVM backend enabled for Windows #598
Conversation
bors try |
@@ -0,0 +1,3 @@ | |||
pub fn round_up_to_page_size(size: usize) -> usize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Page size is not always 4kib on any given system. Windows and Linux both support different sized pages in the same running system.
On unix, it's libc::sysconf(_SC_PAGESIZE)
but not on Windows, which suggests maybe this isn't really platform common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was same code as before, just moved into a new file.
Perhaps we can address this in a separate PR?
ptr_out: &mut *mut u8, | ||
size_out: &mut usize, | ||
) -> LLVMResult { | ||
let size = round_up_to_page_size(size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming the rust mmap follows POSIX mmap, neither the addr
nor length
arguments need to be page size aligned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referring to previous comment:
This was same code as before, just moved into a new file.
Perhaps we can address this in a separate PR?
} | ||
|
||
pub unsafe fn dealloc_memory(ptr: *mut u8, size: usize) -> LLVMResult { | ||
let res = munmap(ptr as _, round_up_to_page_size(size)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need round_up_to_page_size here either (though it helps to keep the sizes to mmap and munmap the same).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referring to previous comment:
This was same code as before, just moved into a new file.
Perhaps we can address this in a separate PR?
bors try |
This PR:
Note: this PR is based on the previous effort done by: #259