about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-07-12auto merge of #7734 : alexcrichton/rust/issue-3395, r=sanxiynbors-2/+2
Also ends up fixing one case in libstd. Closes #3395
2013-07-12auto merge of #7725 : msullivan/rust/default-methods, r=pcwaltonbors-1/+1
r?
2013-07-12auto merge of #7736 : thestinger/rust/doc, r=thestingerbors-22/+73
2b96408 r=sanxiyn documents conversion, size hints and double-ended iterators and adds more of the traits to the prelude
2013-07-12Account for possible 0-sized elements in vector iteratorsAlex Crichton-13/+68
Closes #7733
2013-07-12Remove the global 'vec::to_owned' functionAlex Crichton-6/+1
2013-07-12auto merge of #7696 : glinscott/rust/utf8_perf, r=cmrbors-36/+76
Moves multibyte code to it's own function to make char_range_at easier to inline, and faster for single and multibyte chars. Benchmarked reading example.json 100 times, 1.18s before, 1.08s after. Also, optimize str::is_utf8 for the single and multibyte case Before: is_utf8_ascii: 272.355162 ms is_utf8_multibyte: 167.337334 ms After: is_utf8_ascii: 218.088049 ms is_utf8_multibyte: 134.836722 ms
2013-07-12extend the iterator tutorialDaniel Micay-3/+4
documents conversion, size hints and double-ended iterators and adds more of the traits to the prelude
2013-07-11auto merge of #7677 : alexcrichton/rust/tls-gc, r=pcwaltonbors-243/+591
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-11Expand ctypes warnings to warn about *int/*uintAlex Crichton-2/+2
Also ends up fixing one case in libstd
2013-07-11Fix testsAlex Crichton-1/+1
2013-07-11Take default methods out from behind the flag.Michael Sullivan-1/+1
2013-07-11auto merge of #7707 : thestinger/rust/double, r=cmrbors-54/+87
00da76d r=cmr 6e75f2d r=cmr This implements the trait for vector iterators, replacing the reverse iterator types. The methods will stay, for implementing the future reverse Iterable traits and convenience. This can also be trivially implemented for circular buffers and other variants of arrays like strings. The `DoubleEndedIterator` trait will allow for implementing algorithms like in-place reverse on generic mutable iterators. The naming (`Range` vs. `Iterator`, `Bidirectional` vs. `DoubleEnded`) can be bikeshedded in the future.
2013-07-11Optimize is_utf8Gary Linscott-8/+16
Manually unroll the multibyte loops, and optimize for the single byte chars.
2013-07-11char_range_at perf workGary Linscott-28/+60
Moves multibyte code to it's own function to make char_range_at easier to inline, and faster for single and multibyte chars. Benchmarked reading example.json 100 times, 1.18s before, 1.08s after.
2013-07-11auto merge of #7708 : bcully/rust/warnings, r=thestingerbors-1/+3
Just getting my feet wet.
2013-07-11auto merge of #7693 : korenchkin/rust/fixdoc_rand, r=cmrbors-19/+31
All of the examples were still using `core::` instead of `std::` and needed a `use std::rand;` at the top to compile Most of the examples had `rng = rand::rng();` instead of `let mut rng = rand::rng();`
2013-07-11Remove all external requirements of `@` from TLSAlex Crichton-16/+16
Closes #6004
2013-07-11Fix a soundness problem with `get`Alex Crichton-31/+79
2013-07-11Work around stage0 to remove '@' requirements from TLSAlex Crichton-75/+334
2013-07-10auto merge of #7691 : nikomatsakis/rust/vec-split-method, r=thestingerbors-1/+37
I don't think we have this yet. This makes `&mut [T]` much more flexible. r? @strcat (or whomever)
2013-07-11vec: rm inline(never) hackDaniel Micay-13/+2
just avoid giving an inline hint in the first place
2013-07-11iterator: add DoubleEndedIterator conceptDaniel Micay-41/+85
This implements the trait for vector iterators, replacing the reverse iterator types. The methods will stay, for implementing the future reverse Iterable traits and convenience. This can also be trivially implemented for circular buffers and other variants of arrays like strings and `SmallIntMap`/`SmallIntSet`. The `DoubleEndedIterator` trait will allow for implementing algorithms like in-place reverse on generic mutable iterators. The naming (`Range` vs. `Iterator`, `Bidirectional` vs. `DoubleEnded`) can be bikeshedded in the future.
2013-07-10remove unused importsBrendan Cully-1/+3
2013-07-10auto merge of #7690 : kevinmehall/rust/document-c_void, r=huonwbors-0/+7
I added documentation for when to use and not to use `c_void`, since it tripped me up when I started. (See issue #7627)
2013-07-10auto merge of #7683 : alexcrichton/rust/issue-7625, r=thestingerbors-2/+8
Closes #7625
2013-07-10Add a `mut_split()` method for dividing one `&mut [T]` into twoNiko Matsakis-1/+37
2013-07-10Fixed exampleskorenchkin-19/+31
The examples were still using `core::` instead of `std::` All of the examples needed a `use std::rand;` at the top to compile Most of the examples had `rng = rand::rng();` instead of `let mut rng = rand::rng();`
2013-07-10Document std::libc::c_void.Kevin Mehall-0/+7
2013-07-10Added overloaded Add and Sub traits for pointer arithmetic=Mark Sinclair-0/+96
Implemented ptr arithmetic for *T and *mut T. Tests passing
2013-07-10Merge pull request #7682 from thestinger/vecDaniel Micay-7/+26
vec::with_capacity: do one alloc for non-managed + ptr module improvements
2013-07-10Don't loop infinitely on 0-size structs in reprAlex Crichton-2/+8
Closes #7625
2013-07-09ptr: optimize {swap,replace,read}_ptrDaniel Micay-6/+6
2013-07-09vec::with_capacity: do one alloc for non-managedDaniel Micay-1/+20
2013-07-09auto merge of #7265 : brson/rust/io-upstream, r=brsonbors-2033/+5384
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-66/+76
2013-07-09Change TLS to almost be able to contain owned typesAlex Crichton-87/+145
2013-07-09Change the elements in the task-local map to be actual key-value pairsAlex Crichton-127/+111
2013-07-09Use purely an owned vector for storing TLS dataAlex Crichton-47/+36
2013-07-09std::rt: Ignore 0-byte udp readsBrian Anderson-0/+7
2013-07-09std::rt: Do local tests in a bare thread to not interfere with the schedulerBrian Anderson-21/+30
2013-07-09auto merge of #7657 : thestinger/rust/rollup, r=thestingerbors-3/+78
d3be8ab r=brson 05eb3cf r=thestinger c80f4e1 r=huonw 8c27af1 r=huonw 0eee0b6 r=cmr ea2756a r=thestinger
2013-07-09Fix typo in docs for MutableCloneableVectorKevin Ballard-1/+1
2013-07-09Impl Not for boolBrendan Zabarauskas-0/+25
2013-07-09std: Implement `Iterator::size_hint` method for `Option` iteratorsAndrew Paseltiner-0/+50
2013-07-09remove the unused exchange_malloc `align` parameterDaniel Micay-2/+2
`malloc` already returns memory correctly aligned for every possible type in standard C, and that's enough for all types in Rust too
2013-07-09auto merge of #7117 : jensnockert/rust/freestanding, r=cmrbors-283/+105
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, float, int, and uint are replaced with generic functions in num instead. This means that instead of having to know everywhere what the type is, like ~~~ f64::sin(x) ~~~ You can simply write code that uses the type-generic versions in num instead, this works for all types that implement the corresponding trait in num. ~~~ num::sin(x) ~~~ Note 1: If you were previously using any of those functions, just replace them with the corresponding function with the same name in num. Note 2: If you were using a function that corresponds to an operator, use the operator instead. Note 3: This is just https://github.com/mozilla/rust/pull/7090 reopened against master.
2013-07-09std: Make os::set_exit_status work with newschedBrian Anderson-3/+40
2013-07-09std::rt: size_t, not u64Brian Anderson-2/+2
2013-07-09auto merge of #7528 : indutny/rust/feature/memory-api, r=cmrbors-9/+829
@cmr this is still WIP and I haven't tested it on windows, but anyway.
2013-07-09os: introduce cross-platform MemoryMap bindingsFedor Indutny-4/+358
Basically, one may just do: MemoryMap::new(16, ~[ MapExecutable, MapReadable, MapWritable ]) And executable+readable+writable chunk of at least 16 bytes size will be allocated and freed with the result of `MemoryMap::new`.