summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-08-22std: naive stdio print test in uvioJeff Olson-0/+20
2013-08-22std: UvFileStream implements HomingIO + .home_for_io() wrapper usageJeff Olson-39/+60
2013-08-22std: writing to stdout only works when using -1 offset..Jeff Olson-1/+1
2013-08-22std: lint appeasement for unused param in condition handlerJeff Olson-1/+1
2013-08-22std: rework file io.. support [p]read,[p]write, impl seek/tell + more testsJeff Olson-53/+214
2013-08-22std: adding #[fixed_stack_segment] as needed in new uvll callsJeff Olson-0/+16
2013-08-22std: add FileStream::unlink + more testsJeff Olson-2/+52
2013-08-22std: rt::io::file::FileStream fleshed out.. needs more work.. see extendedJeff Olson-40/+127
- change all uses of Path in fn args to &P - FileStream.read assumptions were wrong (libuv file io is non-positional) - the above will mean that we "own" Seek impl info .. should probably push it in UvFileDescriptor.. - needs more tests
2013-08-22std: CRUD file io bindings in uvio, fs_open()/unlink() in IoFactory + testJeff Olson-0/+190
2013-08-22std: remove fcntl const bindings + making valgrind clean w/ no owned vecsJeff Olson-142/+68
2013-08-22std: support async/threadpool & sync paths in uv_fs_* calls + add sync testJeff Olson-35/+169
2013-08-22std: add read and unlink to low-level FileDescriptor + end-to-end CRUD testJeff Olson-53/+119
2013-08-22std: working tests for low-level libuv open, write and close operationsJeff Olson-27/+126
2013-08-22std: bootstrapping libuv-based fileio in newrt... open & closeJeff Olson-14/+222
the test "touch"es a new file
2013-08-22Implement size_hint() on RangeInclusiveKevin Ballard-0/+15
2013-08-22doc: Fix transmute exampleKeegan McAllister-1/+4
2013-08-22auto merge of #8666 : nikomatsakis/rust/issue-3678-extern-fn-types, r=pcwaltonbors-22/+153
Change the type of crust fns like this one: extern fn foo() { ... } from `*u8` to `extern "C" fn()`. r? @pcwalton (or whomever)
2013-08-21auto merge of #8590 : blake2-ppc/rust/std-str, r=alexcrichtonbors-131/+254
Implement CharIterator as a separate struct, so that it can be .clone()'d. Fix `.char_range_at_reverse` so that it performs better, closer to the forwards version. This makes the reverse iterators and users like `.rfind()` perform better. Before test str::bench::char_iterator ... bench: 146 ns/iter (+/- 0) test str::bench::char_iterator_ascii ... bench: 397 ns/iter (+/- 49) test str::bench::char_iterator_rev ... bench: 576 ns/iter (+/- 8) test str::bench::char_offset_iterator ... bench: 128 ns/iter (+/- 2) test str::bench::char_offset_iterator_rev ... bench: 425 ns/iter (+/- 59) After test str::bench::char_iterator ... bench: 130 ns/iter (+/- 1) test str::bench::char_iterator_ascii ... bench: 307 ns/iter (+/- 5) test str::bench::char_iterator_rev ... bench: 185 ns/iter (+/- 8) test str::bench::char_offset_iterator ... bench: 131 ns/iter (+/- 13) test str::bench::char_offset_iterator_rev ... bench: 183 ns/iter (+/- 2) To be able to use a string slice to represent the CharIterator, a function `slice_unchecked` is added, that does the same as `slice_bytes` but without any boundary checks. It would be possible to implement CharIterator with pointer arithmetic to make it *much more efficient*, but since vec iterator is still improving, it's too early to attempt to re-implement it in other places. Hopefully CharIterator can be implemented on top of vec iterator without any unsafe code later. Additional changes fix the documentation about null termination.
2013-08-21std/extra: changing XXX to FIXME; cleanupTim Chevalier-42/+40
* Get rid of by-value-self workarounds; it works now * Remove type annotations, they're not needed anymore
2013-08-21Don't fail in port.try_recv() the second time. Close #7800.Ben Blum-6/+13
2013-08-22std::str: Add test for CharIterator .clone()blake2-ppc-0/+8
2013-08-21auto merge of #8445 : Florob/rust/unicode, r=graydonbors-1/+2406
This adds support for performing Unicode Normalization Forms D and KD on strings. To enable this the decomposition and canonical combining class properties are added to std::unicode. On my system this increases libstd's size by ~250KiB.
2013-08-21auto merge of #8610 : kballard/rust/mod_floor, r=alexcrichtonbors-2/+15
`mod_floor()` was incorrectly defined for uint types as `a / b` instead of `a % b`.
2013-08-21auto merge of #8604 : kballard/rust/iter-size-hint, r=graydonbors-11/+100
Implement `size_hint()` on the new std::vec Iterators. Add or update `size_hint()` on std::iterator Iterators where appropriate. r? @thestinger
2013-08-21Adjust callbacks in the libraries for the new type of extern fnsNiko Matsakis-22/+153
cc #3678
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.