Skip to content

core: a few core::os fns ported to rust + ptr::array_each #5013

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

Closed
wants to merge 8 commits into from
Closed

core: a few core::os fns ported to rust + ptr::array_each #5013

wants to merge 8 commits into from

Conversation

olsonjeffery
Copy link
Contributor

Happy Presidents' Day!

Four things:

  • added ptr::array_each() to core, used to iterate over the elements in a **T. ptr::array_each assumes the provided array is null-terminated and determins length via ptr::buf_len. There is a ptr:array_each_with_len that takes a length parameter
  • ported os::get_cwd() to rust, calling into C library fns in core::libc
  • ported os::env() to rust. The win32 version uses API available in libc::funcs::extra::kernel32, while the _nix versions still use the rust_env_pairs in rt, which now just return the _*environ (in platform applicable fashion).
  • porting os::list_dir() to rust (unix is complete, windows complete)

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.

@olsonjeffery
Copy link
Contributor Author

bleh. i hazarded to rebase against incoming based on a mistaken impression that history would be preserved.. but obviously not.. it's been blown away. apologies for the inconvenience, won't rebase again.

working on getting os:list_dir() finished.. that'll remove the last of the make_str / kernel->malloc's / etc from rust_builtin.cpp.

@olsonjeffery
Copy link
Contributor Author

adding ptr::array_each() is done as a part of c5c60c8

@brson
Copy link
Contributor

brson commented Mar 11, 2013

I'll fix that and try again. I want those windows test fixes.

@brson brson mentioned this pull request Mar 11, 2013
@brson brson closed this Mar 11, 2013
bors added a commit that referenced this pull request Mar 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants