about summary refs log tree commit diff
path: root/src/libstd/os.rs
AgeCommit message (Collapse)AuthorLines
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-6/+92
2013-08-18auto merge of #8551 : huonw/rust/speling, r=alexcrichtonbors-1/+1
(This doesn't add/remove `u`s or change `ize` to `ise`, or anything like that.)
2013-08-16doc: convert remaining uses of core:: to std::.Huon Wilson-1/+1
2013-08-15Add ToCStr method .with_c_str()Kevin Ballard-24/+24
.with_c_str() is a replacement for the old .as_c_str(), to avoid unnecessary boilerplate. Replace all usages of .to_c_str().with_ref() with .with_c_str().
2013-08-10std: merge Iterator and IteratorUtilErick Tryzelaar-1/+1
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-1/+1
cc #7887
2013-08-09auto merge of #8296 : erickt/rust/remove-str-trailing-nulls, r=ericktbors-104/+114
This PR fixes #7235 and #3371, which removes trailing nulls from `str` types. Instead, it replaces the creation of c strings with a new type, `std::c_str::CString`, which wraps a malloced byte array, and respects: * No interior nulls * Ends with a trailing null
2013-08-09Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-2/+2
remove-str-trailing-nulls
2013-08-09Remove the C++ runtime. SayonaraBrian Anderson-24/+4
2013-08-09std: more windows fixes to os.rs and run.rsErick Tryzelaar-3/+5
2013-08-09std: Fix perf of local allocations in newschedBrian Anderson-2/+2
Mostly optimizing TLS accesses to bring local heap allocation performance closer to that of oldsched. It's not completely at parity but removing the branches involved in supporting oldsched and optimizing pthread_get/setspecific to instead use our dedicated TCB slot will probably make up for it.
2013-08-08Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-3/+1
remove-str-trailing-nulls
2013-08-08std: more fixes for os.rs for windowsErick Tryzelaar-2/+3
2013-08-07std: import HANDLE for os::list_dir for windowsErick Tryzelaar-0/+1
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-3/+1
2013-08-06Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-3/+3
remove-str-trailing-nulls
2013-08-05std: fix a typo where .to_c_str wasn't being called on androidErick Tryzelaar-1/+1
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-3/+3
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-04Merge remote-tracking branch 'remotes/origin/master' into str-remove-nullErick Tryzelaar-8/+8
2013-08-04std: remove use of cast module from os.Erick Tryzelaar-13/+6
2013-08-04std: merge str::raw::from_buf and str::raw::from_c_strErick Tryzelaar-1/+1
2013-08-04std and rustc: explicitly pass c strings to c functionsErick Tryzelaar-42/+52
When strings lose their trailing null, this pattern will become dangerous: let foo = "bar"; let foo_ptr: *u8 = &foo[0]; Instead we should use c_strs to handle this correctly.
2013-08-04std: replace str::as_c_str with std::c_strErick Tryzelaar-30/+33
2013-08-04std: cleanup os and str testsErick Tryzelaar-28/+28
2013-08-04std: add str.to_c_str()Erick Tryzelaar-1/+1
2013-08-03remove obsolete `foreach` keywordDaniel Micay-8/+8
this has been replaced by `for`
2013-08-02librustc: Disallow "unsafe" for external functionsPatrick Walton-22/+28
2013-08-02replace `range` with an external iteratorDaniel Micay-4/+3
2013-08-01std: Replace `for` with `do { .. }` expr where internal iterators are usedblake2-ppc-1/+2
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-6/+6
2013-08-01make `in` and `foreach` get treated as keywordsDaniel Micay-17/+17
2013-07-30implement pointer arithmetic with GEPDaniel Micay-3/+3
Closes #8118, #7136 ~~~rust extern mod extra; use std::vec; use std::ptr; fn bench_from_elem(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = vec::from_elem(1024, 0u8); } } fn bench_set_memory(b: &mut extra::test::BenchHarness) { do b.iter { let mut v: ~[u8] = vec::with_capacity(1024); unsafe { let vp = vec::raw::to_mut_ptr(v); ptr::set_memory(vp, 0, 1024); vec::raw::set_len(&mut v, 1024); } } } fn bench_vec_repeat(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = ~[0u8, ..1024]; } } ~~~ Before: test bench_from_elem ... bench: 415 ns/iter (+/- 17) test bench_set_memory ... bench: 85 ns/iter (+/- 4) test bench_vec_repeat ... bench: 83 ns/iter (+/- 3) After: test bench_from_elem ... bench: 84 ns/iter (+/- 2) test bench_set_memory ... bench: 84 ns/iter (+/- 5) test bench_vec_repeat ... bench: 84 ns/iter (+/- 3)
2013-07-23std: remove a malloc from os::fill_charp_bufErick Tryzelaar-3/+2
2013-07-23std: move StrUtil::as_c_str into StrSliceErick Tryzelaar-12/+11
2013-07-23std: remove os::as_c_charpErick Tryzelaar-30/+26
2013-07-22std: Move change_dir_locked to unstable. #7870Brian Anderson-40/+0
2013-07-22std::rt: Stop using unstable::global in change_dir_lockedBrian Anderson-14/+26
2013-07-22auto merge of #7942 : Dretch/rust/os-listdir-path-no-squiggle, r=brsonbors-2/+2
2013-07-22new snapshotDaniel Micay-3/+0
2013-07-21Remove what appears to be redundant indirection fromGareth Smith-2/+2
os::list_dir_path.
2013-07-20librustc: Remove `pub extern` and `priv extern` from the language.Patrick Walton-6/+6
Place `pub` or `priv` on individual items instead.
2013-07-18Fix warnings in libstd and librusti testsblake2-ppc-1/+0
2013-07-17librustc: Remove the `Copy` bound from the language.Patrick Walton-4/+0
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-9/+12
2013-07-14Make TLS keys actually take up spaceAlex Crichton-1/+1
If the TLS key is 0-sized, then the linux linker is apparently smart enough to put everything at the same pointer. OSX on the other hand, will reserve some space for all of them. To get around this, the TLS key now actuall consumes space to ensure that it gets a unique pointer
2013-07-14Purge the last remnants of the old TLS apiAlex Crichton-9/+8
Closes #3273
2013-07-11auto merge of #7677 : alexcrichton/rust/tls-gc, r=pcwaltonbors-2/+2
cc #6004 and #3273 This is a rewrite of TLS to get towards not requiring `@` when using task local storage. Most of the rewrite is straightforward, although there are two caveats: 1. Changing `local_set` to not require `@` is blocked on #7673 2. The code in `local_pop` is some of the most unsafe code I've written. A second set of eyes should definitely scrutinize it... The public-facing interface currently hasn't changed, although it will have to change because `local_data::get` cannot return `Option<T>`, nor can it return `Option<&T>` (the lifetime isn't known). This will have to be changed to be given a closure which yield `&T` (or as an Option). I didn't do this part of the api rewrite in this pull request as I figured that it could wait until when `@` is fully removed. This also doesn't deal with the issue of using something other than functions as keys, but I'm looking into using static slices (as mentioned in the issues).
2013-07-11Remove all external requirements of `@` from TLSAlex Crichton-1/+1
Closes #6004
2013-07-09auto merge of #7265 : brson/rust/io-upstream, r=brsonbors-6/+24
r? @graydon, @nikomatsakis, @pcwalton, or @catamorphism Sorry this is so huge, but it's been accumulating for about a month. There's lots of stuff here, mostly oriented toward enabling multithreaded scheduling and improving compatibility between the old and new runtimes. Adds task pinning so that we can create the 'platform thread' in servo. [Here](https://github.com/brson/rust/blob/e1555f9b5628af2b6c6ed344cad621399cb7684d/src/libstd/rt/mod.rs#L201) is the current runtime setup code. About half of this has already been reviewed.
2013-07-09Rename local_data methods/types for less keystrokesAlex Crichton-2/+2