summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-08-21auto merge of #8602 : sanxiyn/rust/sysconf, r=graydonbors-224/+214
Linux and Android share the kernel, but not the C library, so sysconf constants are different. For example, _SC_PAGESIZE is 30 on Linux, but 39 on Android. This patch * splits sysconf constants to sysconf module * merges non-MIPS and MIPS sysconf constants (they are same) * adds Android sysconf constants This patch also lets mmap tests to pass on Android.
2013-08-21auto merge of #8600 : sfackler/rust/http, r=brsonbors-30/+0
It's an empty stub and as one of the comments notes, doesn't belong in libstd.
2013-08-21Add support for performing NFD and NFKD on stringsFlorian Zeitz-0/+143
2013-08-21Add canonical combining class to std::unicodeFlorian Zeitz-0/+166
2013-08-21Add Unicode decomposition mappings to std::unicodeFlorian Zeitz-1/+2097
2013-08-21auto merge of #8582 : thestinger/rust/container, r=thestingerbors-158/+221
5f3a637 r=huonw 934a5eb r=thestinger 0f6e90a r=cmr
2013-08-20enable tests for the container tutorialDaniel Micay-3/+3
2013-08-20iterator: add a method for reversing a containerDaniel Micay-2/+30
this works on any container with a mutable double-ended iterator
2013-08-20option: derive Clone/DeepClone for the iteratorDaniel Micay-0/+1
2013-08-20vec: add `shrink_to_fit`Daniel Micay-0/+26
Closes #4960
2013-08-20rm obsolete float to_str_radix free functionsDaniel Micay-74/+53
2013-08-20rm obsolete integer to_str{,_radix} free functionsDaniel Micay-81/+57
2013-08-20iterator: add a `range_inclusive` functionDaniel Micay-0/+52
Closes #6242
2013-08-20container: inline contains_key default methodDaniel Micay-0/+1
2013-08-20auto merge of #8656 : toddaaro/rust/idle-opt+cleaning, r=brsonbors-14/+17
Fixed a memory leak caused by the singleton idle callback failing to close correctly. The problem was that the close function requires running inside a callback in the event loop, but we were trying to close the idle watcher after the loop returned from run. The fix was to just call run again to process this callback. There is an additional tweak to move the initialization logic fully into bootstrap, so tasks that do not ever call run do not have problems destructing.
2013-08-20auto merge of #8631 : anasazi/rust/homing-io, r=brsonbors-348/+679
libuv handles are tied to the event loop that created them. In order to perform IO, the handle must be on the thread with its home event loop. Thus, when as task wants to do IO it must first go to the IO handle's home event loop and pin itself to the corresponding scheduler while the IO action is in flight. Once the IO action completes, the task is unpinned and either returns to its home scheduler if it is a pinned task, or otherwise stays on the current scheduler. Making new blocking IO implementations (i.e. files) thread safe is rather simple. Add a home field to the IO handle's struct in uvio and implement the HomingIO trait. Wrap every IO call in the HomingIO.home_for_io method, which will take care of the scheduling. I'm not sure if this remains thread safe in the presence of asynchronous IO at the libuv level. If we decide to do that, then this set up should be revisited.
2013-08-20Fixed a memory leak caused by the singleton idle callback failing to close ↵toddaaro-14/+17
correctly. The problem was that the close function requires running inside a callback in the event loop, but we were trying to close the idle watcher after the loop returned from run. The fix was to just call run again to process this callback. There is an additional tweak to move the initialization logic fully into bootstrap, so tasks that do not ever call run do not have problems destructing.
2013-08-20small cleanups in task/spawn.rsBen Blum-45/+32
2013-08-20auto merge of #8519 : msullivan/rust/objects, r=catamorphismbors-1/+1
r?
2013-08-20Added home_for_io_with_sched variant. Temporarily making IO unkillable.Eric Reed-124/+165
2013-08-20Add assert_once_ever macro. Close #7748. (fixme cf #8472)Ben Blum-0/+37
2013-08-20Moved .sleep() to Timer.Eric Reed-7/+2
2013-08-20auto merge of #8566 : toddaaro/rust/idle-opt+cleaning, r=catamorphism,brsonbors-302/+386
Instead of a furious storm of idle callbacks we just have one. This is a major performance gain - around 40% on my machine for the ping pong bench. Also in this PR is a cleanup commit for the scheduler code. Was previously up as a separate PR, but bors load + imminent merge hell led me to roll them together. Was #8549.
2013-08-19std: Restore dynamic borrow trackingBrian Anderson-17/+43
2013-08-19Make IO thread-safe.Eric Reed-660/+653
Each IO handle has a home event loop, which created it. When a task wants to use an IO handle, it must first make sure it is on that home event loop. It uses the scheduler handle in the IO handle to send itself there before starting the IO action. Once the IO action completes, the task restores its previous home state. If it is an AnySched task, then it will be executed on the new scheduler. If it has a normal home, then it will return there before executing any more code after the IO action.
2013-08-19Homed UDP socketsEric Reed-24/+213
2013-08-19Working homing UDP socket prototype.Eric Reed-1/+151
2013-08-19Instruct event loops to ignore SIGPIPE when constructed.Eric Reed-0/+1
libuv does not always catch SIGPIPE.
2013-08-19Do not execute the callback before cleaning up resources.Eric Reed-8/+6
2013-08-19Derive Clone for IpAddr and SocketAddrEric Reed-2/+2
2013-08-19Try to fix mac valgrind bot by disabling thread-heavy activities.Graydon Hoare-15/+64
2013-08-19auto merge of #8459 : thestinger/rust/checked, r=graydonbors-2/+42
2013-08-19clean whitespace :/toddaaro-6/+6
2013-08-19Rangechange the log message truncation limit.Michael Sullivan-1/+1
2013-08-19std::str: Use iterators instead of while loops for CharSplitIteratorblake2-ppc-33/+45
Embed an iterator in the CharSplitIterator struct, and combine that with the former bool `only_ascii`; so use an enum instead.
2013-08-19auto merge of #8535 : nikomatsakis/rust/issue-3678-wrappers-be-gone-2, r=graydonbors-48/+489
Long-standing branch to remove foreign function wrappers altogether. Calls to C functions are done "in place" with no stack manipulation; the scheme relies entirely on the correct use of `#[fixed_stack_segment]` to guarantee adequate stack space. A linter is added to detect when `#[fixed_stack_segment]` annotations are missing. An `externfn!` macro is added to make it easier to declare foreign fns and wrappers in one go: this macro may need some refinement, though, for example it might be good to be able to declare a group of foreign fns. I leave that for future work (hopefully somebody else's work :) ). Fixes #3678.
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-48/+489
2013-08-19std::str: Improve comments for CharIteratorblake2-ppc-1/+9
2013-08-19std::str: Use CharOffsetIterator in slice_charsblake2-ppc-13/+14
2013-08-19std::str: Only check char boundary for end index in .slice_to()blake2-ppc-1/+2
2013-08-19std::str: Correct docstrings for lack of null terminator in ~str and &strblake2-ppc-24/+13
2013-08-19std::str: Use CharOffsetIterator in .find() and .rfind()blake2-ppc-6/+3
2013-08-19std::str: Implement CharIterator separatelyblake2-ppc-35/+68
Let CharIterator be a separate type from CharOffsetIterator (so that CharIterator can be cloned, for example). Implement CharOffsetIterator by using the same technique as the method subslice_offset.
2013-08-19std::str: Add str::raw::slice_uncheckedblake2-ppc-4/+13
Add a function like raw::slice_bytes, but it doesn't check slice boundaries. For iterator use where we always know the begin, end indices are in range.
2013-08-19std::str: Special case char_range_at_reverse so it is fasterblake2-ppc-13/+21
Implement char_range_at_reverse similarly to char_range_at, instead of re-using that method.
2013-08-19std::str: Small fix for sliceblake2-ppc-2/+3
2013-08-19std::str: Bench test for char iteratorsblake2-ppc-0/+56
2013-08-19auto merge of #8564 : alexcrichton/rust/ifmt+++, r=graydonbors-4/+58
See discussion in #8489, but this selects option 3 by adding a `Default` trait to be implemented by various basic types. Once this makes it into a snapshot I think it's about time to start overhauling all current use-cases of `fmt!` to move towards `ifmt!`. The goal is to replace `%X` with `{}` in 90% of situations, and this commit should enable that.
2013-08-19Fix mod_floor() for uint primitive typesKevin Ballard-2/+15
2013-08-18Update size_hint()s on std::iterator IteratorsKevin Ballard-10/+31
Add size_hint() to a few Iterators that were missing it. Update a couple of existing size_hint()s to use checked_add() instead of saturating_add() for the upper bound.