about summary refs log tree commit diff
path: root/src/libstd/rt/args.rs
AgeCommit message (Collapse)AuthorLines
2014-02-16std: Rename unstable::mutex::Mutex to StaticNativeMutex.Huon Wilson-2/+2
This better reflects its purpose and design.
2014-02-16std: add an RAII unlocker to Mutex.Huon Wilson-11/+4
This automatically unlocks its lock when it goes out of scope, and provides a safe(ish) method to call .wait.
2014-02-14Use str::from_utf8_lossy() in os::args(), add os::args_as_bytes()Kevin Ballard-21/+23
os::args() was using str::raw::from_c_str(), which would assert if the C-string wasn't valid UTF-8. Switch to using from_utf8_lossy() instead, and add a separate function os::args_as_bytes() that returns the ~[u8] byte-vectors instead.
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-2/+2
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-01-07Fixup the rest of the tests in the compilerAlex Crichton-1/+1
2014-01-07Fix remaining cases of leaking importsAlex Crichton-0/+2
2013-12-20std: silence warnings when compiling test.Huon Wilson-5/+8
2013-11-26Clean up statically initialized data on shutdownAlex Crichton-4/+5
Whenever the runtime is shut down, add a few hooks to clean up some of the statically initialized data of the runtime. Note that this is an unsafe operation because there's no guarantee on behalf of the runtime that there's no other code running which is using the runtime. This helps turn down the noise a bit in the valgrind output related to statically initialized mutexes. It doesn't turn the noise down to 0 because there are still statically initialized mutexes in dynamic_lib and os::with_env_lock, but I believe that it would be easy enough to add exceptions for those cases and I don't think that it's the runtime's job to go and clean up that data.
2013-11-26librustc: Fix merge fallout.Patrick Walton-3/+3
2013-11-26libstd: Fix Win32 and other bustage.Patrick Walton-5/+5
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-2/+1
2013-11-18Move runtime files to C instead of C++Alex Crichton-0/+1
Explicitly have the only C++ portion of the runtime be one file with exception handling. All other runtime files must now live in C and be fully defined in C.
2013-11-18Remove the C++ lock_and_signal typeAlex Crichton-22/+31
A the same time this purges all runtime support needed for statically initialized mutexes, moving all users over to the new Mutex type instead.
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-3/+5
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-3/+3
Who doesn't like a massive renaming?
2013-10-09option: rewrite the API to use compositionDaniel Micay-2/+2
2013-09-30std: Remove usage of fmt!Alex Crichton-3/+3
2013-09-18Register new snapshotsAlex Crichton-12/+0
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-1/+1
The trait will keep the `Iterator` naming, but a more concise module name makes using the free functions less verbose. The module will define iterables in addition to iterators, as it deals with iteration in general.
2013-08-29rt: use sugary functions rather than manual range loops.Huon Wilson-5/+4
2013-08-21std/extra: changing XXX to FIXME; cleanupTim Chevalier-2/+2
* Get rid of by-value-self workarounds; it works now * Remove type annotations, they're not needed anymore
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-4/+14
2013-08-03remove obsolete `foreach` keywordDaniel Micay-1/+1
this has been replaced by `for`
2013-08-02replace `range` with an external iteratorDaniel Micay-4/+3
2013-07-30implement pointer arithmetic with GEPDaniel Micay-1/+1
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-24fix compilation on macos/windowsDaniel Micay-1/+2
2013-07-24std:rt: args module is not used by win/mac. #7951Brian Anderson-69/+123
2013-06-21std::rt: Support os::argsBrian Anderson-0/+125