Conversation
|
@youknowone I found that it can't be compiled in main branch with such error: Do i miss something? |
|
build errors not reproduced by CI is mostly rust version problem. |
|
@youknowone Got it, my rust version is older. |
fanninpm
left a comment
There was a problem hiding this comment.
Some of your libc imports are causing rustc and/or clippy to complain.
|
There's a test in Can you copy |
|
@fanninpm thank you. This PR isn't ready for review, it's draft right now. I have some protocols such as |
|
@youknowone @fanninpm But there are still some work to do because of
And i don't implement this module on windows platform too. Please help me review this module, thank you. |
|
Can you break out |
|
@fanninpm Of course, i will break it out. |
youknowone
left a comment
There was a problem hiding this comment.
Great! You made a big feature! I left a few comments.
|
@youknowone @fermian @qingshi163 Thank you for all your comments, i will resolve them ASAP. |
|
@youknowone I tried to address all the CR problems in 3ba2341 Please review this PR again. Thank you. |
|
@fanninpm @youknowone @qingshi163 I tried to address all CR problems again in commit eed1537 and fixed |
|
@youknowone I rebased the commits , split the |
b5e9c1f to
a93435d
Compare
fanninpm
left a comment
There was a problem hiding this comment.
Almost there! Just a few quick changes.
Even if anyone else hasn't already said this, thank you for contributing a significant amount of time and effort on this.
stdlib/src/mmap.rs
Outdated
| #[cfg(target_os = "linux")] | ||
| libc::MADV_FREE => Advice::Free, |
There was a problem hiding this comment.
This is also present on macOS and iOS, as of memmap2 v0.5.4. If this doesn't work, you may need to have Cargo refresh the Cargo.lock file.
| #[cfg(target_os = "linux")] | |
| libc::MADV_FREE => Advice::Free, | |
| #[cfg(any(target_os = "linux", target_vendor = "apple"))] | |
| libc::MADV_FREE => Advice::Free, |
(Please note that memmap2 does not currently support BSD systems, as the upstream maintainer has not currently set up CI for them.)
stdlib/src/mmap.rs
Outdated
| #[cfg(target_os = "linux")] | ||
| #[pyattr] | ||
| use libc::{ | ||
| MADV_DODUMP, MADV_DOFORK, MADV_DONTDUMP, MADV_DONTFORK, MADV_FREE, MADV_HUGEPAGE, |
There was a problem hiding this comment.
MADV_FREE is also present on Apple devices (and the four major BSDs).
I suggest using something like this (with applicable formatting):
#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "fuchsia", target_os = "freebsd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", target_vendor = "apple"))]
#[pyattr]
use libc::MADV_FREE;As for the other imports from libc, I recommend searching the .txt files in https://github.com/rust-lang/libc to see exactly which platforms are compatible with which constants/methods from libc.
stdlib/src/mmap.rs
Outdated
| 0 => dist, /* relative to start */ | ||
| 1 => { | ||
| /* relative to current position */ | ||
| let pos = self.pos(); | ||
| if (((isize::MAX as usize) - pos) as isize) < dist { | ||
| return Err(vm.new_value_error("seek out of range".to_owned())); | ||
| } | ||
| pos as isize + dist | ||
| } | ||
| 2 => { | ||
| /* relative to end */ |
There was a problem hiding this comment.
Very minor nitpick: These comments (/* ... */) are inconsistent with the other comments in this file (// ...).
|
|
|
I changed memmap2 version to |
youknowone
left a comment
There was a problem hiding this comment.
Great! Thank you for the long time effort!
|
@youknowone @fanninpm Thank you for all your helper. |
Try to implement mmap module #2059
Supersedes and closes #3564