Skip to content

Commit 08d0ff3

Browse files
committed
rt: Remove new_chan. Not needed
1 parent 0dc8387 commit 08d0ff3

File tree

3 files changed

+3
-16
lines changed

3 files changed

+3
-16
lines changed

src/rt/rust_builtin.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -484,18 +484,6 @@ get_port_id(rust_port *port) {
484484
return port->id;
485485
}
486486

487-
extern "C" CDECL rust_chan*
488-
new_chan(rust_port *port) {
489-
rust_task *task = rust_scheduler::get_task();
490-
rust_scheduler *sched = task->sched;
491-
LOG(task, comm, "new_chan("
492-
"task=0x%" PRIxPTR " (%s), port=0x%" PRIxPTR ")",
493-
(uintptr_t) task, task->name, port);
494-
I(sched, port);
495-
return new (task->kernel, "rust_chan")
496-
rust_chan(task->kernel, port, port->unit_sz);
497-
}
498-
499487
extern "C" CDECL
500488
void del_chan(rust_chan *chan) {
501489
rust_task *task = rust_scheduler::get_task();

src/rt/rust_port.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#include "rust_internal.h"
22
#include "rust_port.h"
3+
#include "rust_chan.h"
34

4-
extern "C" CDECL rust_chan*
5-
new_chan(rust_port *port);
65

76
rust_port::rust_port(rust_task *task, size_t unit_sz)
87
: ref_count(1), kernel(task->kernel), task(task),
@@ -13,7 +12,8 @@ rust_port::rust_port(rust_task *task, size_t unit_sz)
1312
PRIxPTR, (uintptr_t)task, unit_sz, (uintptr_t)this);
1413

1514
id = task->register_port(this);
16-
remote_chan = new_chan(this);
15+
remote_chan = new (task->kernel, "rust_chan")
16+
rust_chan(task->kernel, this, unit_sz);
1717
}
1818

1919
rust_port::~rust_port() {

src/rt/rustrt.def.in

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ last_os_error
3030
leak
3131
migrate_alloc
3232
nano_time
33-
new_chan
3433
new_port
3534
new_task
3635
pin_task

0 commit comments

Comments
 (0)