about summary refs log tree commit diff
path: root/src/libstd/unstable
AgeCommit message (Collapse)AuthorLines
2013-07-30Implement select() for new runtime pipes.Ben Blum-13/+41
2013-07-30implement pointer arithmetic with GEPDaniel Micay-0/+7
Closes #8118, #7136 ~~~rust extern mod extra; use std::vec; use std::ptr; fn bench_from_elem(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = vec::from_elem(1024, 0u8); } } fn bench_set_memory(b: &mut extra::test::BenchHarness) { do b.iter { let mut v: ~[u8] = vec::with_capacity(1024); unsafe { let vp = vec::raw::to_mut_ptr(v); ptr::set_memory(vp, 0, 1024); vec::raw::set_len(&mut v, 1024); } } } fn bench_vec_repeat(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = ~[0u8, ..1024]; } } ~~~ Before: test bench_from_elem ... bench: 415 ns/iter (+/- 17) test bench_set_memory ... bench: 85 ns/iter (+/- 4) test bench_vec_repeat ... bench: 83 ns/iter (+/- 3) After: test bench_from_elem ... bench: 84 ns/iter (+/- 2) test bench_set_memory ... bench: 84 ns/iter (+/- 5) test bench_vec_repeat ... bench: 84 ns/iter (+/- 3)
2013-07-29auto merge of #8085 : mrordinaire/rust/percent-p, r=huonwbors-0/+7
pull request for #8011
2013-07-29Added %p directive to fmt!, which expects *T as argumentDo Nhat Minh-0/+7
2013-07-28Fix spelling errorsJames Miller-2/+2
2013-07-28Add static initializers for atomicsJames Miller-5/+26
2013-07-28Add an atomic fence intrinsicJames Miller-0/+36
2013-07-27Fix nits.Steven Stewart-Gallus-9/+7
2013-07-27Change concurrency primitives to standard naming conventionsSteven Stewart-Gallus-49/+51
To be more specific: `UPPERCASETYPE` was changed to `UppercaseType` `type_new` was changed to `Type::new` `type_function(value)` was changed to `value.method()`
2013-07-27auto merge of #8040 : luqmana/rust/rtn, r=brsonbors-2/+2
Implements various missing tcp & udp methods.. Also fixes handling ipv4-mapped/compatible ipv6 addresses and addresses the XXX on `status_to_maybe_uv_error`. r? @brson
2013-07-26auto merge of #7986 : alexcrichton/rust/raw-repr, r=brsonbors-0/+62
This moves the raw struct layout of closures, vectors, boxes, and strings into a new `unstable::raw` module. This is meant to be a centralized location to find information for the layout of these values. As safe method, `unwrap`, is provided to convert a rust value to its raw representation. Unsafe methods to convert back are not provided because they are rarely used and too numerous to write an implementation for each (not much of a common pattern). This is progress on #6790. I tried to get a nice interface for a trait to implement in the raw module, but I was unable to come up with one. The hard part is that there are so many different directions to go from one way to another that it's difficult to find a pattern to follow to implement a trait with. Someone else might have some better luck though.
2013-07-26Consolidate raw representations of rust valuesAlex Crichton-0/+62
This moves the raw struct layout of closures, vectors, boxes, and strings into a new `unstable::raw` module. This is meant to be a centralized location to find information for the layout of these values. As safe method, `repr`, is provided to convert a rust value to its raw representation. Unsafe methods to convert back are not provided because they are rarely used and too numerous to write an implementation for each (not much of a common pattern).
2013-07-25libstd: Fix errors when rtdebug! is not a noop.Luqman Aden-2/+2
2013-07-25Added some more atomic operations.Gábor Horváth-2/+184
2013-07-24auto merge of #7996 : erickt/rust/cleanup-strs, r=ericktbors-2/+2
This is a cleanup pull request that does: * removes `os::as_c_charp` * moves `str::as_buf` and `str::as_c_str` into `StrSlice` * converts some functions from `StrSlice::as_buf` to `StrSlice::as_c_str` * renames `StrSlice::as_buf` to `StrSlice::as_imm_buf` (and adds `StrSlice::as_mut_buf` to match `vec.rs`. * renames `UniqueStr::as_bytes_with_null_consume` to `UniqueStr::to_bytes` * and other misc cleanups and minor optimizations
2013-07-23std and extra: use as_c_str instead of as_buf in a couple placesErick Tryzelaar-2/+2
These uses are assuming the strings are null terminated, so it should be using `as_c_str` instead of `as_buf`
2013-07-23std: move str::as_buf into StrSliceErick Tryzelaar-1/+1
2013-07-23Added missing memory orderings for atomic types.Gábor Horváth-0/+12
2013-07-22std: Remove at_exit API. UnusedBrian Anderson-102/+0
2013-07-22std: Remove unstable::global. UnusedBrian Anderson-282/+0
2013-07-22std: Move change_dir_locked to unstable. #7870Brian Anderson-0/+50
2013-07-22std: Remove weak_task API. UnusedBrian Anderson-212/+0
2013-07-22new snapshotDaniel Micay-9/+0
2013-07-20librustc: Remove `pub extern` and `priv extern` from the language.Patrick Walton-11/+12
Place `pub` or `priv` on individual items instead.
2013-07-20Fix warnings in stdtest and extratest. Maybe somebody will care.Ben Blum-1/+0
2013-07-20Stash a spare kill flag inside tasks, to save two atomic xadds in the ↵Ben Blum-0/+12
blocking fastpath.
2013-07-20Add KillHandle and implement exit code propagation to replace join_latchBen Blum-3/+3
2013-07-20Add UnsafeAtomicRcBox::try_unwrap()Ben Blum-1/+68
2013-07-20Reimplement ARC::unwrap() and friends.Ben Blum-19/+211
2013-07-20Add AtomicOption::fill() and AtomicOption::is_empty()Ben Blum-0/+38
2013-07-20Remove redundant Atomic{Ui,I}nt types from unstable::syncBen Blum-68/+0
2013-07-18auto merge of #7833 : blake2-ppc/rust/hashmap-consume, r=alexcrichtonbors-1/+1
Updated all users of HashMap, HashSet ::consume() to use .consume_iter(). Since .consume_iter() takes the map or set by value, it needs awkward extra code to in librusti's use of @mut HashMap, where the map value can not be directly moved out. Addresses issue #7719
2013-07-18hashmap: Remove .consume() has rename .consume_iter() to .consume()blake2-ppc-1/+1
Updated all users of HashMap, HashSet old .consume() to use .consume() with a for loop. Since .consume() takes the map or set by value, it needs awkward extra code to in librusti's use of @mut HashMap, where the map value can not be directly moved out.
2013-07-17rm unused visit_str method from TyVisitorDaniel Micay-1/+0
2013-07-15remove headers from unique vectorsDaniel Micay-0/+1
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-11Expand ctypes warnings to warn about *int/*uintAlex Crichton-2/+2
Also ends up fixing one case in libstd
2013-07-09auto merge of #7265 : brson/rust/io-upstream, r=brsonbors-248/+88
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-09auto merge of #7117 : jensnockert/rust/freestanding, r=cmrbors-2/+2
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-08Merge remote-tracking branch 'mozilla/master'Brian Anderson-0/+16
Conflicts: src/libextra/test.rs src/libstd/rt/global_heap.rs src/libstd/unstable/lang.rs src/libstd/vec.rs
2013-07-08 Replaces the free-standing functions in f32, &c.Jens Nockert-2/+2
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. If you were previously using any of those functions, just replace them with the corresponding function with the same name in num. Note: If you were using a function that corresponds to an operator, use the operator instead.
2013-07-08remove headers from exchange allocationsDaniel Micay-0/+1
2013-07-06auto merge of #7194 : jensnockert/rust/endian, r=cmrbors-0/+14
They simply byte-swap an integer to a specific endian, like the hton* functions in C. These intrinsics are synthesized, so maybe they should be in another file. But since they are just a single line of code each, based on the bswap intrinsics and aren't really intended for public consumption I thought they would fit in the intrinsics file. The next step working on this could be to expose a trait / generic function for byteswapping.
2013-07-03Merge remote-tracking branch 'mozilla/master'Brian Anderson-133/+221
Conflicts: src/libextra/test.rs src/libstd/at_vec.rs src/libstd/cleanup.rs src/libstd/rt/comm.rs src/libstd/rt/global_heap.rs src/libstd/task/spawn.rs src/libstd/unstable/lang.rs src/libstd/vec.rs src/rt/rustrt.def.in src/test/run-pass/extern-pub.rs
2013-07-01Refactored the runtime to view coroutines as a component of tasks, instead ↵toddaaro-0/+4
of tasks as a component of coroutines.
2013-07-01rustc: add a lint to enforce uppercase statics.Huon Wilson-4/+5
2013-06-30add a contains_managed intrinsicDaniel Micay-0/+4
2013-06-30simplify the exchange allocatorDaniel Micay-100/+0
* stop using an atomic counter, this has a significant cost and valgrind will already catch these leaks * remove the extra layer of function calls * remove the assert of non-null in free, freeing null is well defined but throwing a failure from free will not be * stop initializing the `prev`/`next` pointers * abort on out-of-memory, failing won't necessarily work
2013-06-28Rewrite each_path to allow performance improvements in the future.Patrick Walton-0/+1
Instead of determining paths from the path tag, we iterate through modules' children recursively in the metadata. This will allow for lazy external module resolution.
2013-06-28librustc: Change "Owned" to "Send" everywherePatrick Walton-13/+13