about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-08-03remove obsolete `foreach` keywordDaniel Micay-231/+231
this has been replaced by `for`
2013-08-03register snapshotsDaniel Micay-32/+1
2013-08-03auto merge of #8213 : kballard/rust/fd-limit, r=brsonbors-4/+83
Revert the workaround 49b72bd and instead bump the fd limit on OS X.
2013-08-03std: expose the keyed HashMap constructor, for runtime-less use.Huon Wilson-28/+26
The `new` constructor uses the task-local RNG to retrieve seeds for the two key values, which requires the runtime. Exposing a constructor that takes the keys directly allows HashMaps to be used in programs that wish to avoid the runtime.
2013-08-03auto merge of #8204 : kballard/rust/str-into-owned, r=graydonbors-0/+12
The method .into_owned() is meant to be used as an optimization when you need to get a ~str from a Str, but don't want to unnecessarily copy it if it's already a ~str. This is meant to ease functions that look like fn foo<S: Str>(strs: &[S]) Previously they could work with the strings as slices using .as_slice(), but producing ~str required copying the string, even if the vector turned out be a &[~str] already. I don't have any concrete uses for this yet, since the one conversion I've done to `&[S]` so far (see PR #8203) didn't actually need owned strings. But having this here may make using `Str` more attractive. It also may be worth adding an `into_managed()` function, but that one is less obviously useful than `into_owned()`.
2013-08-03std: add benchmark for vec.mut_iter.Huon Wilson-0/+13
2013-08-03std: use ptr.offset where possible in the vec iterator.Huon Wilson-8/+38
Closes #8212.
2013-08-03option: mutate() and mutate_default() should return boolKevin Ballard-5/+24
Fixes #8047.
2013-08-03fixed the buffer to make it a more reasonable sizetoddaaro-1/+1
2013-08-03modified logging function to truncate output and adjusted error output ↵toddaaro-0/+10
formatting tests to be compatible with both the new and old runtimes
2013-08-03make `for` parse as `foreach` doesDaniel Micay-1/+3
Closes #6997
2013-08-03replace all remaining `for` with `foreach` or `do`Daniel Micay-70/+94
2013-08-02librustc: Disallow "unsafe" for external functionsPatrick Walton-623/+539
2013-08-02Bump fd limit on macos when running rt testsKevin Ballard-0/+78
OS X defaults the ulimit for open files to 256 for programs launched from the Terminal (GUI apps get a higher default). Unfortunately this is too low for the rt tests, which deliberately overcommit and create a lot of threads (which means a lot of schedulers, and each scheduler needs at least 2 fds). By calling sysctl() and setrlimit() we can bump the fd limit up to the maximum allowed (on stock OS X it's 10240). Fixes #7772.
2013-08-02Revert "std::rt: Use a constant 4 threads for multithreaded sched tests"Kevin Ballard-4/+5
This workaround was less than ideal. A better solution is to raise the fd limit. This reverts commit 49b72bdd77916e27aaf95909516702c1450f11ac.
2013-08-02Add an assert_may_sleep() check on every context switch.Ben Blum-0/+4
2013-08-02Don't fail from kill signals if already unwinding.Ben Blum-3/+3
2013-08-02(cleanup) Use more do...finally in extra::sync.Ben Blum-0/+6
2013-08-02Fix embarrassing bug where 'unkillable' would unwind improperly when it ↵Ben Blum-2/+44
receives a kill signal.
2013-08-02Fix nasty double-free bug where a newrt chan could get killed after ↵Ben Blum-2/+7
rescheduling but before suppressing_finalize.
2013-08-02Add SendDeferred trait and use it to fix #8214.Ben Blum-24/+157
2013-08-02auto merge of #8221 : brson/rust/single-threaded, r=graydonbors-16/+107
This is the last major runtime feature needed for the transition to the new scheduler.
2013-08-02auto merge of #8195 : bblum/rust/task-cleanup, r=brsonbors-29/+94
In the first commit it is obvious why some of the barriers can be changed to ```Relaxed```, but it is not as obvious for the once I changed in ```kill.rs```. The rationale for those is documented as part of the documenting commit. Also the last commit is a temporary hack to prevent kill signals from being received in taskgroup cleanup code, which could be fixed in a more principled way once the old runtime is gone.
2013-08-02auto merge of #8193 : cmr/rust/linux-errno, r=graydonbors-0/+107
2013-08-02auto merge of #8175 : brson/rust/nodbg, r=graydonbors-2/+0
This stuff is ancient, unused, and tied to oldsched
2013-08-02std: Implement SingleThreaded spawn mode for newschedBrian Anderson-16/+107
2013-08-02replace `range` with an external iteratorDaniel Micay-90/+84
2013-08-01str: Add method .into_owned(self) -> ~str to StrKevin Ballard-0/+12
The method .into_owned() is meant to be used as an optimization when you need to get a ~str from a Str, but don't want to unnecessarily copy it if it's already a ~str. This is meant to ease functions that look like fn foo<S: Str>(strs: &[S]) Previously they could work with the strings as slices using .as_slice(), but producing ~str required copying the string, even if the vector turned out be a &[~str] already.
2013-08-01modified local to include an implementation for try_unsafe_borrow::<Task> so ↵toddaaro-10/+17
that the log methods will work
2013-08-01fixed incorrect handling of returned scheduler option and restructed ↵toddaaro-75/+64
scheduler functions slightly
2013-08-01minor tweaks - unboxed the coroutine so that it is no longer a ~ pointer ↵toddaaro-32/+72
inside the task struct, and also added an assert to verify that send is never called inside scheduler context as it is undefined (BROKEN) if that happens
2013-08-01Fixed a race where a scheduler configured to only run tasks pinned to it ↵toddaaro-8/+35
would "bounch" a regular task in and out of the work queue without allowing a different scheduler to run it.
2013-08-01Have linked failure tests run on the new scheduler instead of requiring ↵Ben Blum-79/+152
RUST_NEWRT to test.
2013-08-01A major refactoring that changes the way the runtime uses TLS. In thetoddaaro-1022/+887
old design the TLS held the scheduler struct, and the scheduler struct held the active task. This posed all sorts of weird problems due to how we wanted to use the contents of TLS. The cleaner approach is to leave the active task in TLS and have the task hold the scheduler. To make this work out the scheduler has to run inside a regular task, and then once that is the case the context switching code is massively simplified, as instead of three possible paths there is only one. The logical flow is also easier to follow, as the scheduler struct acts somewhat like a "token" indicating what is active. These changes also necessitated changing a large number of runtime tests, and rewriting most of the runtime testing helpers. Polish level is "low", as I will very soon start on more scheduler changes that will require wiping the polish off. That being said there should be sufficient comments around anything complex to make this entirely respectable as a standalone commit.
2013-08-01Temporary workaround to prevent taskgroup cleanup code from failing without ↵Ben Blum-3/+13
an exception handler.
2013-08-01Make a forgotten assert in comm be cfg(test)-dependentBen Blum-3/+1
2013-08-01Document task killing design and relaxed barrier rationale.Ben Blum-1/+57
2013-08-01Relax some atomic barriers. Loosen up all that tension. There, doesn't that ↵Ben Blum-22/+23
feel good?
2013-08-01auto merge of #8190 : thestinger/rust/for, r=thestingerbors-255/+243
2013-08-01Add a boatload of Linux x86/x86-64/arm errnosCorey Richardson-0/+107
2013-08-01migrate to foreachDaniel Micay-2/+2
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-54/+53
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
2013-08-01std: Replace `for` with `do { .. }` expr in std::gcblake2-ppc-62/+52
Change all users of old-style for with internal iterators to using `do`-loops. The code in stackwalk.rs does not actually implement the looping protocol (no break on return false). The code in gc.rs does not use loop breaks, nor does any code using it. We remove the capacity to break from the loops in std::gc and implement the walks using `do { .. }` expressions. No behavior change.
2013-08-01std: Remove the internal iterator methods from trait Setblake2-ppc-33/+1
.intersection(), .union() etc methods in trait std::container::Set use internal iters. Remove these methods from the trait. I reported issue #8154 for the reinstatement of iterator-based set algebra methods to the Set trait. For bitv and treemap, that lack Iterator implementations of set operations, preserve them as methods directly on the types themselves. For HashSet, these methods are replaced by the present .union_iter() etc.
2013-08-01std: Replace `for` with `do { .. }` expr where internal iterators are usedblake2-ppc-71/+86
2013-08-01std: Use `do` blocks instead of `for` with .iter_bytes()blake2-ppc-33/+49
2013-08-01auto merge of #8164 : brson/rust/noportset, r=pcwaltonbors-81/+2
...haredChan.
2013-08-01auto merge of #8158 : bblum/rust/task-cleanup, r=brsonbors-74/+139
r? @brson
2013-08-01auto merge of #8155 : stepancheg/rust/unit-zero, r=alexcrichtonbors-0/+11
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-215/+220