Memory manager clarity improvements#987
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #987 +/- ##
==========================================
+ Coverage 52.95% 53.27% +0.32%
==========================================
Files 126 126
Lines 18187 18308 +121
Branches 4329 4385 +56
==========================================
+ Hits 9631 9754 +123
+ Misses 5861 5852 -9
- Partials 2695 2702 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
nix::Error is a more strongly-typed alternative to i32.
ef733f1 to
b8a2292
Compare
src/main/host/memory_manager.rs
Outdated
| /* old_len: */ self.heap.end - self.heap.start, | ||
| /* new_len: */ new_heap.end - new_heap.start, |
There was a problem hiding this comment.
Can these use range.len()?
There was a problem hiding this comment.
Yup, missed these ones. Thanks!
src/main/host/memory_manager.rs
Outdated
| // Extend the portion of the stack that we've mapped downward to include `src`. | ||
| // | ||
| // This is carefuly designed *not* to invalidate any outstanding borrowed references or | ||
| // pointers, since otherwise a caller trying to marshall multiple syscall arguments might | ||
| // invalidate the first argument when marshalling the second. (While the Rust API currently | ||
| // prevents there from being any outstanding references, the C API does not). |
There was a problem hiding this comment.
Make these /// so that they show up in the docs? (And for other functions in this file.)
There was a problem hiding this comment.
Does it make sense to use /// for non-public methods? I suppose it doesn't hurt...
There was a problem hiding this comment.
I think it makes sense, since if you're developing the library itself and not just using it in another project, you may run cargo doc --document-private-items which will include those functions. And rust seems to use /// for non-public methods as well: https://doc.rust-lang.org/src/alloc/vec.rs.html#2978
robgjansen
left a comment
There was a problem hiding this comment.
Thanks for the extra comments! I'm happy if Steven's happy :)
I'm always happy so that's not a good basis for decision making :) (I thought I approved this PR when I left a review, but I guess not, so approving now.) |
println!to logging macros.