Skip to content

Commit 4880065

Browse files
nikomatsakisbrson
authored andcommitted
rip out unused task pointers
1 parent d9b23cb commit 4880065

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/lib/comm.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ native "c-stack-cdecl" mod rustrt {
1212
type void;
1313
type rust_port;
1414

15-
fn chan_id_send<~T>(unused_task: *void, t: *sys::type_desc,
15+
fn chan_id_send<~T>(t: *sys::type_desc,
1616
target_task: task::task, target_port: port_id,
1717
-data: T);
1818

19-
fn new_port(unused_task: *void, unit_sz: uint) -> *rust_port;
20-
fn del_port(unused_task: *void, po: *rust_port);
21-
fn drop_port(unused_task: *void, po: *rust_port);
22-
fn get_port_id(unused_task: *void, po: *rust_port) -> port_id;
19+
fn new_port(unit_sz: uint) -> *rust_port;
20+
fn del_port(po: *rust_port);
21+
fn drop_port(po: *rust_port);
22+
fn get_port_id(po: *rust_port) -> port_id;
2323
}
2424

2525
native "rust-intrinsic" mod rusti {
@@ -33,20 +33,20 @@ type port_id = int;
3333
tag chan<~T> { chan_t(task::task, port_id); }
3434

3535
resource port_ptr(po: *rustrt::rust_port) {
36-
rustrt::drop_port(ptr::null(), po);
37-
rustrt::del_port(ptr::null(), po);
36+
rustrt::drop_port(po);
37+
rustrt::del_port(po);
3838
}
3939

4040
tag port<~T> { port_t(@port_ptr); }
4141

4242
fn send<~T>(ch: chan<T>, -data: T) {
4343
let chan_t(t, p) = ch;
44-
rustrt::chan_id_send(ptr::null(), sys::get_type_desc::<T>(), t, p, data);
44+
rustrt::chan_id_send(sys::get_type_desc::<T>(), t, p, data);
4545
task::yield();
4646
}
4747

4848
fn port<~T>() -> port<T> {
49-
let p = rustrt::new_port(ptr::null(), sys::size_of::<T>());
49+
let p = rustrt::new_port(sys::size_of::<T>());
5050
ret port_t(@port_ptr(p));
5151
}
5252

@@ -55,6 +55,6 @@ fn recv<~T>(p: port<T>) -> T {
5555
}
5656

5757
fn chan<~T>(p: port<T>) -> chan<T> {
58-
let id = rustrt::get_port_id(ptr::null(), ***p);
58+
let id = rustrt::get_port_id(***p);
5959
ret chan_t(task::get_task_id(), id);
6060
}

src/rt/rust_builtin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,8 @@ void drop_port(rust_port *port) {
559559
port->ref_count--;
560560
}
561561

562-
extern "C" CDECL void
563-
chan_send(rust_chan *chan, void *sptr) {
562+
extern "C" CDECL
563+
void chan_send(rust_chan *chan, void *sptr) {
564564
chan->send(sptr);
565565
}
566566

0 commit comments

Comments
 (0)