| Age | Commit message (Collapse) | Author | Lines |
|
Manually unroll the multibyte loops, and optimize for the single
byte chars.
|
|
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.
|
|
|
|
Just getting my feet wet.
|
|
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();`
|
|
Closes #6004
|
|
|
|
|
|
I don't think we have this yet. This makes `&mut [T]` much more flexible.
r? @strcat (or whomever)
|
|
just avoid giving an inline hint in the first place
|
|
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.
|
|
|
|
I added documentation for when to use and not to use `c_void`, since it tripped me up when I started. (See issue #7627)
|
|
Closes #7625
|
|
|
|
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();`
|
|
|
|
Implemented ptr arithmetic for *T and *mut T. Tests passing
|
|
vec::with_capacity: do one alloc for non-managed + ptr module improvements
|
|
|
|
Also added unit tests of range code to test refactoring. The
num-range-rev.rs test will need to be updated when the range_rev
semantics change.
|
|
Closes #7625
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d3be8ab r=brson
05eb3cf r=thestinger
c80f4e1 r=huonw
8c27af1 r=huonw
0eee0b6 r=cmr
ea2756a r=thestinger
|
|
|
|
|
|
|
|
`malloc` already returns memory correctly aligned for every possible
type in standard C, and that's enough for all types in Rust too
|
|
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.
|
|
|
|
|
|
@cmr this is still WIP and I haven't tested it on windows, but anyway.
|
|
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`.
|
|
This should never cause a segfault, but rather fail somehow. Possibly a condition could be used here, but for now there's not much else to do.
|
|
r=catamorphism
Correct treatment of irrefutable patterns. The old code was wrong in many, many ways. `ref` bindings didn't work, it sometimes copied when it should have moved, the borrow checker didn't even look at such patterns at all, we weren't consistent about preventing values with destructors from being pulled apart, etc.
Fixes #3224.
Fixes #3225.
Fixes #3255.
Fixes #6225.
Fixes #6386.
r? @catamorphism
|
|
|
|
|
|
Conflicts:
src/libextra/test.rs
src/libstd/rt/global_heap.rs
src/libstd/unstable/lang.rs
src/libstd/vec.rs
|
|
|
|
Conflicts:
src/libstd/rt/test.rs
|
|
|