core: a few core::os fns ported to rust + ptr::array_each #5013
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.
Happy Presidents' Day!
Four things:
ptr::array_each()
tocore
, used to iterate over the elements in a**T
.ptr::array_each
assumes the provided array is null-terminated and determins length viaptr::buf_len
. There is aptr:array_each_with_len
that takes a length parameteros::get_cwd()
to rust, calling into C library fns incore::libc
os::env()
to rust. The win32 version uses API available inlibc::funcs::extra::kernel32
, while the _nix versions still use therust_env_pairs
in rt, which now just return the_*environ
(in platform applicable fashion).The latter three are towards finishing #4812 .
core tests are passing in linux and OSX. I have an issue with my windows vm where rustc chews up and keeps hitting the 32bit process memory limit before segfaulting on one of the stage1 library builds. But I know that libcore builds on win32.