Ben Blum
2e6dc161b6
Give tasks useful names. #2891
2013-07-31 14:37:22 -04:00
bors
8b7e241e02
auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwalton
...
This removes a bunch of options from the task builder interface that are irrelevant to the new scheduler and were generally unused anyway. It also bumps the stack size of new scheduler tasks so that there's enough room to run rustc and changes the interface to `Thread` to not implicitly join threads on destruction, but instead require an explicit, and mandatory, call to `join`.
2013-07-31 02:10:24 -07:00
bors
5633a5363b
auto merge of #8008 : bblum/rust/select, r=brson
...
Main logic in ```Implement select() for new runtime pipes.```. The guts of the ```PortOne::try_recv()``` implementation are now split up across several functions, ```optimistic_check```, ```block_on```, and ```recv_ready```.
There is one weird FIXME I left open here, in the "implement select" commit -- an assertion I couldn't get to work in the receive path, on an invariant that for some reason doesn't hold with ```SharedPort```. Still investigating this.
2013-07-30 18:58:17 -07:00
Brian Anderson
0144c83213
std::rt: Change Thread interface to require an explicit join
...
Makes it more obvious what's going on
2013-07-30 14:23:44 -07:00
Brian Anderson
7265cc6530
std::rt: Use 2MB stacks
...
Seems to be around the minimum needed by rustc without split stacks
2013-07-30 14:17:56 -07:00
Ben Blum
6b75e92afe
UnsafeArc methods return unsafe pointers, so are not themselves unsafe.
2013-07-30 13:19:26 -04:00
Ben Blum
fa8102ab4a
Unkillable is not unsafe. Close #7832 .
2013-07-30 13:19:25 -04:00
Ben Blum
3f6b4c24ec
Add a better-for-testing optimistic_check() for pipes with cfg(test).
2013-07-30 13:19:25 -04:00
Ben Blum
cccfa8acc4
Add test cases for select
2013-07-30 13:19:25 -04:00
Ben Blum
f34fadd126
Implement select() for new runtime pipes.
2013-07-30 13:19:25 -04:00
Daniel Micay
ef870d37a5
implement pointer arithmetic with GEP
...
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-30 02:50:31 -04:00
Ben Blum
7326bc879e
Optimize try_recv to not require the two context switches when data is available.
2013-07-29 16:04:16 -04:00
Ben Blum
1137fbd9ab
Remove ChanOneHack/PortOneHack extra allocation
2013-07-29 16:04:16 -04:00
Steven Stewart-Gallus
d0b7515aed
Change concurrency primitives to standard naming conventions
...
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-27 22:06:29 -07:00
bors
3078e83c3f
auto merge of #8076 : omasanori/rust/cleanup, r=huonw
...
A cleanup suggested on #7922 .
2013-07-27 20:13:22 -07:00
bors
82b29ae5a5
auto merge of #7864 : brson/rust/start-on-main-thread, r=brson
...
Applications that need to use the GUI can override start and set up the runtime using
this function.
2013-07-27 18:25:24 -07:00
Brian Anderson
34a27db8bf
std::rt: Add start_on_main_thread function
...
Applications that need to use the GUI can override start and set up the runtime using
this function.
2013-07-27 17:36:14 -07:00
bors
15310ba7c2
auto merge of #8040 : luqmana/rust/rtn, r=brson
...
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-27 01:49:35 -07:00
OGINO Masanori
8d654fc41d
Remove unnecessary #[path = "***/mod.rs"] lines.
...
Fixes #7922 .
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-07-27 15:53:30 +09:00
Alex Crichton
5aaaca0c6a
Consolidate raw representations of rust values
...
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-26 09:53:03 -07:00
Luqman Aden
df67942dcc
libstd: Tests for {peer, socket}_name.
2013-07-26 05:02:53 -04:00
Luqman Aden
037bf3757c
libstd: Implement some missing udp methods.
2013-07-25 22:21:46 -04:00
Luqman Aden
a5c6b85091
libstd: Implement some missing tcp methods.
2013-07-25 19:42:19 -04:00
Luqman Aden
005ea3b173
libstd: Add ToStr impl for IpAddr.
2013-07-25 18:27:18 -04:00
Luqman Aden
d6e1a6b237
libstd: Get rid of duplication in {peer, socket}_name and remove extra *.
2013-07-25 15:50:19 -04:00
Luqman Aden
e2bb32bea1
libstd: Handle IPv4-Mapped/Compatible IPv6 addresses.
2013-07-25 05:57:52 -04:00
Luqman Aden
ac40d5323d
libstd: Fix errors when rtdebug! is not a noop.
2013-07-25 05:57:52 -04:00
Luqman Aden
61e741cf71
libstd: Implement {peer, socket}_name for new rt tcp & udp.
2013-07-25 05:57:52 -04:00
bors
330378d1a1
auto merge of #7996 : erickt/rust/cleanup-strs, r=erickt
...
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-24 13:25:36 -07:00
Daniel Micay
4a2d22bdb1
fix compilation on macos/windows
2013-07-24 09:45:21 -04:00
Brian Anderson
6c88e46d4d
std:rt: args module is not used by win/mac. #7951
2013-07-24 09:45:20 -04:00
bors
7f96eb58d2
auto merge of #7980 : graydon/rust/misc-benchmarks, r=catamorphism
...
Some machinery for enabling #[bench] benchmarks in std and some examples showing how to write them.
2013-07-23 22:46:39 -07:00
Erick Tryzelaar
3b818edeba
std and extra: use as_c_str instead of as_buf in a couple places
...
These uses are assuming the strings are null terminated, so it
should be using `as_c_str` instead of `as_buf`
2013-07-23 16:56:22 -07:00
Erick Tryzelaar
7af56bb921
std: move StrUtil::as_c_str into StrSlice
2013-07-23 16:56:22 -07:00
Erick Tryzelaar
9fdec67a67
std: move str::as_buf into StrSlice
2013-07-23 16:56:22 -07:00
Graydon Hoare
3d5fb470fb
std: add #[bench] benchmarks for global and local heaps.
2013-07-22 16:56:10 -07:00
Jeff Olson
3169bb70d8
std: fix for blocked task resume
2013-07-22 15:28:32 -07:00
Jeff Olson
73ab6c60f3
std: make check appeasement
2013-07-22 13:19:05 -07:00
Jeff Olson
155470fc9c
std: minor timer cleanup based on feedback
2013-07-22 13:19:04 -07:00
Jeff Olson
5da29e3278
std: add rt::io::Timer
2013-07-22 13:19:04 -07:00
Jeff Olson
921d99108c
std: add RtioTimer and UvTimer impl atop rt::uv
2013-07-22 13:19:04 -07:00
Daniel Micay
ed67cdb73c
new snapshot
2013-07-22 01:09:48 -04:00
Patrick Walton
06594ed96b
librustc: Remove pub extern
and priv extern
from the language.
...
Place `pub` or `priv` on individual items instead.
2013-07-20 17:39:38 -07:00
bors
bb8ca1f52c
auto merge of #7910 : brson/rust/rm-fixme, r=graydon
2013-07-20 15:16:33 -07:00
bors
c5c0252511
auto merge of #7908 : anasazi/rust/fix_udp_mut, r=brson
2013-07-20 13:31:34 -07:00
bors
e3142c5d3e
auto merge of #7858 : bblum/rust/kill, r=brson
...
Some notes about the commits.
Exit code propagation commits:
* ```Reimplement unwrap()``` has the same old code from ```arc::unwrap``` ported to use modern atomic types and finally (it's considerably nicer this way)
* ```Add try_unwrap()``` has some new slightly-tricky (but pretty simple) concurrency primitive code
* ```Add KillHandle``` and ```Add kill::Death``` are the bulk of the logic.
Task killing commits:
* ```Implement KillHandle::kill() and friends```, ```Do a task-killed check```, and ```Add BlockedTask``` implement the killing logic;
* ```Change the HOF context switchers``` turns said logic on
Linked failure commits:
* ```Replace *rust_task ptrs``` adapts the taskgroup code to work for both runtimes
* ```Enable taskgroup code``` does what it says on the tin.
r? @brson
2013-07-20 03:55:39 -07:00
Ben Blum
7ad7911222
Add watched and indestructible spawn modes.
2013-07-20 05:12:04 -04:00
Ben Blum
2183145850
Rename TCB to Taskgroup
2013-07-20 05:12:04 -04:00
Ben Blum
f3c79c4026
Enable taskgroup code for newsched spawns.
2013-07-20 05:12:03 -04:00
Ben Blum
9bbec651df
Replace *rust_task ptrs in taskgroup code with TaskHandle, for transitioning to newsched killing.
2013-07-20 05:08:57 -04:00
Ben Blum
2a7273c71e
Stash a spare kill flag inside tasks, to save two atomic xadds in the blocking fastpath.
2013-07-20 05:08:57 -04:00
Ben Blum
e283c4ddff
Add tests for task killing and blocking.
2013-07-20 05:08:57 -04:00
Ben Blum
a093b5434a
Add test::with_test_task() convenience function.
2013-07-20 05:08:57 -04:00
Ben Blum
9ad1997549
Change the HOF context switchers to pass a BlockedTask instead of a ~Task.
2013-07-20 05:08:57 -04:00
Ben Blum
0101f35f27
Add BlockedTask (wake, try_block, etc) in kill.rs.
2013-07-20 05:08:57 -04:00
Ben Blum
e80efe3fda
Do a task-killed check at the start of task 'timeslices'.
2013-07-20 05:08:56 -04:00
Ben Blum
629f6e8d68
Implement KillHandle::kill() and friends (unkillable, atomically). Close #6377 .
2013-07-20 05:08:56 -04:00
Ben Blum
2a99320583
Add tests for KillHandle
2013-07-20 05:08:56 -04:00
Ben Blum
afc199bea0
Remove join_latch
2013-07-20 05:08:56 -04:00
Ben Blum
6882508b6f
Add kill::Death for task death services and use it in Task.
2013-07-20 05:08:56 -04:00
Ben Blum
52ca256d7b
Add KillHandle and implement exit code propagation to replace join_latch
2013-07-20 05:08:56 -04:00
bors
098709aa63
auto merge of #7855 : brson/rust/rt-overcommit, r=pcwalton
...
Too much overcommit here exhausts the low fd limit on OS X.
2013-07-20 00:37:42 -07:00
Brian Anderson
ddd8c156c6
std: Remove old magic core mod
2013-07-19 21:01:24 -04:00
Brian Anderson
73fccf3e70
std::rt: Remove an obsolete FIXME. #7757
2013-07-19 14:36:05 -07:00
Brian Anderson
49b72bdd77
std::rt: Use a constant 4 threads for multithreaded sched tests. #7772
...
Too much overcommit here exhausts the low fd limit on OS X.
2013-07-19 14:18:50 -07:00
Eric Reed
b03f1e7357
Missed the methods of UdpWatcher.
2013-07-19 13:04:03 -07:00
Eric Reed
968f7f5d3d
Changed methods on UDP sockets and TCP/UDP watchers to &mut self to reflect that libuv may change the underlying handle.
2013-07-19 13:04:03 -07:00
bors
f28e581268
auto merge of #7854 : brson/rust/rt-test-threads, r=pcwalton
2013-07-18 17:19:41 -07:00
Patrick Walton
dc4bf173f8
test: Fix tests.
2013-07-17 14:57:55 -07:00
Patrick Walton
2dbb3c3887
test: Fix tests.
2013-07-17 14:57:54 -07:00
Patrick Walton
99b33f7219
librustc: Remove all uses of "copy".
2013-07-17 14:57:51 -07:00
Brian Anderson
b17141370f
std::rt: Rename RUST_TEST_THREADS to RUST_RT_TEST_THREADS
2013-07-17 10:47:05 -07:00
Austin King
712ac836c6
Rename Option swap_unwrap to take_unwrap. Fixes Issue#7764
2013-07-16 12:47:01 -07:00
Daniel Micay
e118555ce6
remove headers from unique vectors
2013-07-15 23:57:27 -04:00
Alex Crichton
9fd2ac7428
Make TLS keys actually take up space
...
If the TLS key is 0-sized, then the linux linker is apparently smart enough to
put everything at the same pointer. OSX on the other hand, will reserve some
space for all of them. To get around this, the TLS key now actuall consumes
space to ensure that it gets a unique pointer
2013-07-14 10:15:07 -07:00
Alex Crichton
e3211fa1f1
Purge the last remnants of the old TLS api
...
Closes #3273
2013-07-14 09:29:12 -07:00
bors
07183ea6e7
auto merge of #7677 : alexcrichton/rust/tls-gc, r=pcwalton
...
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-11 19:52:37 -07:00
Alex Crichton
f9bf69d253
Remove all external requirements of @
from TLS
...
Closes #6004
2013-07-11 00:37:13 -07:00
Alex Crichton
e3fb7062aa
Work around stage0 to remove '@' requirements from TLS
2013-07-11 00:21:26 -07:00
bors
41dcec2fe1
auto merge of #7265 : brson/rust/io-upstream, r=brson
...
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](e1555f9b56/src/libstd/rt/mod.rs (L201)
) is the current runtime setup code.
About half of this has already been reviewed.
2013-07-09 18:28:46 -07:00
Alex Crichton
692a22e69d
Change the elements in the task-local map to be actual key-value pairs
2013-07-09 17:31:01 -07:00
Brian Anderson
413d51e32d
std::rt: Ignore 0-byte udp reads
2013-07-09 16:54:56 -07:00
Brian Anderson
6fb92f8cab
std::rt: Do local tests in a bare thread to not interfere with the scheduler
2013-07-09 15:48:22 -07:00
Daniel Micay
a4af0960bd
remove the unused exchange_malloc align
parameter
...
`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-09 16:35:56 -04:00
Brian Anderson
07e52eb7fc
std: Make os::set_exit_status work with newsched
2013-07-09 13:29:05 -07:00
Brian Anderson
ec6d4a1733
std::rt: size_t, not u64
2013-07-09 11:05:57 -07:00
Brian Anderson
7826651335
Tidy
2013-07-08 17:22:51 -07:00
Brian Anderson
fae3336769
Merge remote-tracking branch 'mozilla/master'
...
Conflicts:
src/libextra/test.rs
src/libstd/rt/global_heap.rs
src/libstd/unstable/lang.rs
src/libstd/vec.rs
2013-07-08 16:29:54 -07:00
Brian Anderson
b227583dad
Merge remote-tracking branch 'anasazi/io'
...
Conflicts:
src/libstd/rt/test.rs
2013-07-08 15:53:11 -07:00
Brian Anderson
4282539523
std::rt: Add a hack to allocate different test port ranges to different bots
2013-07-08 14:41:07 -07:00
Eric Reed
5e0be46852
changed .each() to .iter().advance()
2013-07-08 14:19:39 -07:00
Eric Reed
6b2abcaa0f
renamed finalize to drop in Drop impl for UvUdpSocket
2013-07-08 14:19:19 -07:00
Eric Reed
cf23292010
Merge remote-tracking branch 'upstream/io' into io
...
Conflicts:
src/libstd/rt/uvio.rs
2013-07-08 13:03:18 -07:00
Daniel Micay
90f1db10fa
remove headers from exchange allocations
2013-07-08 04:54:41 -04:00
Daniel Micay
0aedecf96b
add a temporary vector_exchange_malloc lang item
2013-07-08 03:41:21 -04:00
Brian Anderson
1098d6980b
Merge remote-tracking branch 'mozilla/master'
...
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-03 14:49:13 -07:00
Huon Wilson
cdea73cf5b
Convert vec::{as_imm_buf, as_mut_buf} to methods.
2013-07-04 00:46:50 +10:00
Eric Reed
b60cf0c5b0
converted TODOs into XXXs
2013-07-02 17:27:46 -07:00
Eric Reed
6a1a7819c9
Merge remote-tracking branch 'upstream/io' into io
...
Conflicts:
src/libstd/rt/test.rs
src/rt/rustrt.def.in
2013-07-02 16:55:56 -07:00
Eric Reed
e6c57793be
IPv6 support for UDP and TCP.
2013-07-02 16:40:57 -07:00
toddaaro
0607178280
A missing ! made it so that the testcase schedule_home_states was throwing spurious assert failures. Why this did not result in the test case failing previously is beyond me.
2013-07-02 11:44:51 -07:00
toddaaro
27818ea7c4
removed unnecessary import that slipped in during merge
2013-07-01 16:51:59 -07:00
toddaaro
062bfd310a
merging task/coroutine refactoring back into upstream
2013-07-01 16:41:17 -07:00
toddaaro
5cfad4b6de
Refactored the runtime to view coroutines as a component of tasks, instead of tasks as a component of coroutines.
2013-07-01 16:14:56 -07:00
Daniel Micay
5b40f2ae5b
pass exchange_malloc an alignment, not a tydesc
2013-06-30 23:30:40 -04:00
Daniel Micay
0d7799d304
global_heap: inline get_box_size and align_to
2013-06-30 22:41:51 -04:00
Daniel Micay
80ab877841
global_heap: inline malloc_raw and add realloc_raw
2013-06-30 22:22:52 -04:00
Daniel Micay
4a29d6eb3f
add a closure_exchange_malloc lang item
...
this makes the exchange allocation header completely unused, and leaves
it uninitialized
2013-06-30 16:24:47 -04:00
Daniel Micay
408eef0d89
stop initializing ref_count in exchange_alloc
...
this is never read anymore
2013-06-30 16:22:55 -04:00
Daniel Micay
b883d6a54c
simplify the exchange allocator
...
* 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-30 03:45:36 -04:00
Patrick Walton
f9b54541ee
librustc: Disallow "mut" from distributing over bindings.
...
This is the backwards-incompatible part of per-binding-site "mut".
2013-06-28 10:44:15 -04:00
Patrick Walton
1c0aa78481
librustc: Change "Owned" to "Send" everywhere
2013-06-28 10:44:15 -04:00
Huon Wilson
366ca44cc8
std: silence some test warnings.
2013-06-28 01:45:24 +10:00
Huon Wilson
32d655916f
Convert vec::{reserve, reserve_at_least, capacity} to methods.
2013-06-28 00:40:47 +10:00
Huon Wilson
d0512b1055
Convert vec::[mut_]slice to methods, remove vec::const_slice.
2013-06-27 22:36:09 +10:00
Brian Anderson
ddbccecc27
std::rt: Some cleanup
2013-06-26 17:00:42 -07:00
Eric Reed
42f3f069fa
changed NOTE to TODO
2013-06-26 13:48:49 -07:00
Eric Reed
ce97bd4c8b
cleaned up uv/net
2013-06-26 10:17:10 -07:00
Eric Reed
87ecfb7435
converted TCP interface to newtype structs
2013-06-26 09:37:48 -07:00
Eric Reed
d0dc6970d8
removed unecessary method
2013-06-26 09:37:16 -07:00
bors
09b4525f84
auto merge of #7113 : alexcrichton/rust/banned-warnings, r=cmr
...
Reopening of #7031 , Closes #6963
I imagine though that this will bounce in bors once or twice... Because attributes can't be cfg(stage0)'d off, there's temporarily a lot of new stage0/stage1+ code.
2013-06-26 00:56:04 -07:00
Luqman Aden
ca2966c6d0
Change finalize -> drop.
2013-06-25 21:14:39 -04:00
Alex Crichton
c109bed15b
Deny common lints by default for lib{std,extra}
2013-06-25 17:39:43 -07:00
Eric Reed
34b1135b59
Converted UdpSocket into a newtype struct and (dis)connecting uses move semantics rather than ~.
2013-06-25 17:05:59 -07:00
Eric Reed
f604686295
converted UvUdpSocket into a newtype struct
2013-06-25 17:04:28 -07:00
Eric Reed
c5b19f0bf9
changed outdated match on IpAddr
2013-06-25 16:04:09 -07:00
Eric Reed
d0c812f2a8
IPv6 struct
2013-06-25 16:03:24 -07:00
Eric Reed
2c5cfe1037
removed obsolete FIXMEs. formatting changes.
2013-06-25 16:02:51 -07:00
Eric Reed
f202713b73
satisfy the formatting check
2013-06-25 14:40:36 -07:00
Eric Reed
1af2016358
removed unncessary unsafe block that was stopping compliation.
2013-06-25 11:59:47 -07:00
Eric Reed
4870dce3eb
Merge remote-tracking branch 'upstream/io' into io
...
Conflicts:
src/rt/rustrt.def.in
2013-06-25 11:45:44 -07:00
Eric Reed
794923c995
UDP networking with tests
2013-06-25 11:43:40 -07:00
bors
7aee5da08d
auto merge of #7254 : Blei/rust/intrinsic-overhaul, r=cmr
...
This sets the `get_tydesc()` return type correctly and removes the intrinsic module. See #3730 , #3475 .
Update: this now also removes the unused shape fields in tydescs.
2013-06-25 04:38:06 -07:00
Brian Anderson
e65d0cbabe
extra: Make test runner compatible with newsched
2013-06-24 17:07:03 -07:00
Brian Anderson
d071f51cdc
std::rt: deny(unused_unsafe)
2013-06-24 17:07:03 -07:00
Brian Anderson
b530ca1033
std: Make unlinking and task notification work with newsched
2013-06-24 17:07:03 -07:00
Brian Anderson
5e7c5d6c3d
std: Make box annihilator work with newsched
2013-06-24 17:07:03 -07:00
Brian Anderson
a09972db35
std: Move dynamic borrowck code from unstable::lang to rt::borrowck
2013-06-24 17:07:03 -07:00
Brian Anderson
aa9210d25a
std: Rewrite vec_reserve_shared_actual in Rust
2013-06-24 17:07:01 -07:00
Daniel Micay
e2e39234cc
remove old_iter
...
the `test/run-pass/class-trait-bounded-param.rs` test was xfailed and
written in an ancient dialect of Rust so I've just removed it
this also removes `to_vec` from DList because it's provided by
`std::iter::to_vec`
an Iterator implementation is added for OptVec but some transitional
internal iterator methods are still left
2013-06-24 01:35:11 -04:00
Philipp Brüschweiler
469f394b25
Remove intrinsic module
...
To achieve this, the following changes were made:
* Move TyDesc, TyVisitor and Opaque to std::unstable::intrinsics
* Convert TyDesc, TyVisitor and Opaque to lang items instead of specially
handling the intrinsics module
* Removed TypeDesc, FreeGlue and get_type_desc() from sys
Fixes #3475 .
2013-06-23 12:49:16 +02:00
Daniel Micay
d2e9912aea
vec: remove BaseIter implementation
...
I removed the `static-method-test.rs` test because it was heavily based
on `BaseIter` and there are plenty of other more complex uses of static
methods anyway.
2013-06-23 02:05:20 -04:00
Brian Anderson
95eb01957b
std: Make console log off/on controls work with newsched
2013-06-21 16:52:07 -07:00
Brian Anderson
1b7c99655f
std::rt: Support os::args
2013-06-21 14:42:15 -07:00
Brian Anderson
7a9a6e4591
std: Port SharedChan to newsched
2013-06-20 18:26:56 -07:00
Brian Anderson
357f087786
Merge remote-tracking branch 'brson/io' into io-upstream
...
Conflicts:
src/rt/rust_builtin.cpp
src/rt/rustrt.def.in
2013-06-20 12:17:00 -07:00
Brian Anderson
4d39253a96
std::rt: Whitespace
2013-06-20 12:16:04 -07:00
Brian Anderson
bbf5469b75
Merge remote-tracking branch 'brson/io-wip' into io
2013-06-20 11:26:29 -07:00
Eric Reed
55dda46cf6
Merge remote-tracking branch 'upstream/io' into io
2013-06-20 10:51:04 -07:00
Eric Reed
36c0e04e57
derived instances of Eq and TotalEq for IpAddr rather than implement them manually.
2013-06-19 17:39:02 -07:00
Eric Reed
ac49b74e82
socket based UDP io
2013-06-19 17:23:55 -07:00
Brian Anderson
5086c0850e
std::rt: Update GC metadata in init
2013-06-19 16:08:07 -07:00
Eric Reed
083c692565
Changed visibility from being on the impl to being on methods per language syntax change.
2013-06-19 15:39:18 -07:00
toddaaro
753b497b4e
Modified a match in resume_task_from_queue that was returning an int that was then matched on to instead use an enum.
2013-06-19 15:23:14 -07:00
Eric Reed
d777ba01cb
Wrote the Eq instance of IpAddr in a slightly different way.
2013-06-19 15:20:28 -07:00
Brian Anderson
e1555f9b56
std::rt: Document and cleanup the run function
2013-06-19 01:13:56 -07:00
Brian Anderson
5722c953e5
std::rt: Correct the numbers of default cores
2013-06-19 00:49:05 -07:00
Brian Anderson
915aaa7f67
std::rt: Set the process exit code
2013-06-19 00:39:10 -07:00
Brian Anderson
1120f8c1e5
std::rt: Work around a dynamic borrowck bug
2013-06-18 23:20:53 -07:00
Brian Anderson
29ad8e15a2
std::rt: Improve the rtabort! macro
2013-06-18 16:27:48 -07:00
Graydon Hoare
d904c72af8
replace #[inline(always)] with #[inline]. r=burningtree.
2013-06-18 14:48:48 -07:00
Brian Anderson
5b2dc52034
std::rt: Turn on multithreaded scheduling
2013-06-18 00:17:14 -07:00
Brian Anderson
b5fbec9c1e
std: Rename abort!
to rtabort!
to match other macros
2013-06-17 23:24:50 -07:00
Brian Anderson
021e81fbd3
std::rt: move abort function to util module
2013-06-17 23:22:41 -07:00
Brian Anderson
9ef4c413a8
std::rt: Check exchange count on exit
2013-06-17 23:18:20 -07:00
Brian Anderson
3281f5b637
std::rt: Add util mod and num_cpus function
2013-06-17 22:17:51 -07:00
Eric Reed
35f3fa6383
Merge remote-tracking branch 'upstream/io' into io
...
Conflicts:
src/libstd/rt/uvio.rs
2013-06-17 12:45:40 -07:00
Eric Reed
33ae193a3c
Started to implemented UdpStream
2013-06-17 12:35:41 -07:00
Eric Reed
e42f28c05c
stated to implement UdpStream
2013-06-17 12:34:58 -07:00
Eric Reed
47443753f1
added Eq and TotalEq instances for IpAddr
2013-06-17 12:33:46 -07:00
Eric Reed
7e022c590f
added a function to convert C's ipv4 data structure into the Rust ipv4 data structure.
2013-06-17 12:33:10 -07:00
Eric Reed
b51d1885be
Added a RtioUdpStream trait
2013-06-17 12:32:21 -07:00
Eric Reed
9687437d45
added wrappers about uv_ip{4,6}_{port,name}
2013-06-17 12:31:30 -07:00
Brian Anderson
93156ab7e1
std::rt: Reduce the delay on a timer test. Slow
2013-06-16 19:24:51 -07:00
Brian Anderson
319cf6e465
Merge remote-tracking branch 'brson/io'
...
Conflicts:
src/libstd/rt/comm.rs
src/libstd/rt/mod.rs
src/libstd/rt/sched.rs
src/libstd/rt/task.rs
src/libstd/rt/test.rs
src/libstd/rt/tube.rs
src/libstd/rt/uv/uvio.rs
src/libstd/rt/uvio.rs
src/libstd/task/spawn.rs
2013-06-16 15:09:25 -07:00
Brian Anderson
3208fc36bf
Merge remote-tracking branch 'brson/io-wip' into io
...
Conflicts:
src/libstd/rt/sched.rs
src/libstd/rt/task.rs
src/libstd/rt/test.rs
src/libstd/task/mod.rs
src/libstd/task/spawn.rs
2013-06-15 19:31:46 -07:00
Daniel Micay
6c547e42c8
rm vec::uniq_len
2013-06-15 22:16:21 -04:00
Brian Anderson
505ef7e710
std::rt: Tasks contain a JoinLatch
2013-06-15 19:00:44 -07:00
Brian Anderson
b08c446798
Merge remote-tracking branch 'toddaaro/io' into io
2013-06-15 17:00:36 -07:00
toddaaro
d1ec8b5fb8
redesigned the pinning to pin deal with things on dequeue, not on enqueue
2013-06-14 12:17:56 -07:00
Eric Reed
a7f92c92ed
Added a UdpWatcher and UdpSendRequest with associated callbacks
2013-06-14 12:04:11 -07:00
Eric Reed
03fe59aefa
added bindings to extract udp handle from udp send requests
2013-06-14 11:54:56 -07:00
Brian Anderson
90fbe38f00
std::rt: Tasks must have an unwinder. Simpler
2013-06-13 23:18:49 -07:00
Brian Anderson
fd148cd3e2
std::rt: Change the Task constructors to reflect a tree
2013-06-13 23:18:49 -07:00
Brian Anderson
abc3a8aa1e
std::rt: Add JoinLatch
...
This is supposed to be an efficient way to link the lifetimes
of tasks into a tree. JoinLatches form a tree and when `release`
is called they wait on children then signal the parent.
This structure creates zombie tasks which currently keep the entire
task allocated. Zombie tasks are supposed to be tombstoned but that
code does not work correctly.
2013-06-13 23:18:45 -07:00
Daniel Micay
ec27644870
automated whitespace fixes
2013-06-13 18:03:08 -04:00
Eric Reed
5393e43b53
Corrected libuv UDP bindings.
2013-06-13 12:51:32 -07:00
Steven Stewart-Gallus
d9d50a5bd4
Remove unused imports
...
I was able to remove unused imports, and fix the following warnings
src/libstd/hashmap.rs:23:15: 23:23 warning: unused import [-W unused-imports (default)]
src/libstd/task/spawn.rs:95:15: 95:23 warning: unused import [-W unused-imports (default)]
src/libstd/rt/uv/mod.rs:42:0: 42:9 warning: unused import [-W unused-imports (default)]
src/libstd/rt/uv/mod.rs:45:0: 45:9 warning: unused import [-W unused-imports (default)]
src/librustc/middle/trans/meth.rs:26:0: 26:26 warning: unused import [-W unused-imports (default)]
src/librustc/back/link.rs:210:20: 210:25 warning: unused import [-W unused-imports (default)]
I was unable to fix the following unused import warnings. The code
here was weird.
src/libextra/std.rc:40:11: 40:14 warning: unused import [-W unused-imports (default)]
src/libextra/std.rc:40:16: 40:24 warning: unused import [-W unused-imports (default)]
2013-06-13 10:46:17 -07:00
Eric Reed
39a575fb43
Added libuv UDP function bindings.
2013-06-12 16:01:50 -07:00
toddaaro
4224fc7aad
added functionality to tell schedulers to refuse to run tasks that are not pinned to them
2013-06-12 14:55:32 -07:00
Eric Reed
eb11274919
Removing redundant libuv bindings
2013-06-12 14:15:44 -07:00
Brian Anderson
e7213aa21e
std::rt: Remove old files
2013-06-12 12:00:46 -07:00
toddaaro
8428081958
A basic implementation of pinning tasks to schedulers. No IO interactions have been planned for, and no forwarding of tasks off special schedulers is supported.
2013-06-12 11:32:22 -07:00
Huon Wilson
efc71a8bdb
std: unify the str -> [u8] functions as 3 methods: .as_bytes() and .as_bytes_with_null[_consume]().
...
The first acts on &str and is not nul-terminated, the last two act on strings
that are always null terminated (&'static str, ~str and @str).
2013-06-12 12:21:04 +10:00
Brian Anderson
84d2695921
std::rt: Work around a dynamic borrowck bug
2013-06-10 17:46:49 -07:00
toddaaro
d64d26cd39
debugged a compiler ICE when merging local::borrow changes into the main io branch and modified the incoming new file lang.rs to be api-compatible
2013-06-10 15:29:02 -07:00
Ben Blum
8081aea3b8
Tag a bunch of destructors that need mutable self with FIXME for #4330 . Close #4943 .
2013-06-10 18:18:04 -04:00
Ben Blum
967c7d828a
Replace str::raw::buf_as_slice with c_str_to_static_slice. Close #3843 .
2013-06-10 17:34:28 -04:00
Brian Anderson
d83d38c7fe
std::rt: Reduce task stack size to 1MB
2013-06-07 10:23:58 -07:00
Brian Anderson
d4de99aa6c
std::rt: Fix a race in the UvRemoteCallback dtor
2013-06-06 17:53:13 -07:00