about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_builtin.cpp12
-rw-r--r--src/rt/rust_port.cpp6
-rw-r--r--src/rt/rustrt.def.in1
3 files changed, 3 insertions, 16 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 36912ae428d..17cb801d575 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -484,18 +484,6 @@ get_port_id(rust_port *port) {
     return port->id;
 }
 
-extern "C" CDECL rust_chan*
-new_chan(rust_port *port) {
-    rust_task *task = rust_scheduler::get_task();
-    rust_scheduler *sched = task->sched;
-    LOG(task, comm, "new_chan("
-        "task=0x%" PRIxPTR " (%s), port=0x%" PRIxPTR ")",
-        (uintptr_t) task, task->name, port);
-    I(sched, port);
-    return new (task->kernel, "rust_chan")
-        rust_chan(task->kernel, port, port->unit_sz);
-}
-
 extern "C" CDECL
 void del_chan(rust_chan *chan) {
     rust_task *task = rust_scheduler::get_task();
diff --git a/src/rt/rust_port.cpp b/src/rt/rust_port.cpp
index afa4cd738d6..6d83fb2faa9 100644
--- a/src/rt/rust_port.cpp
+++ b/src/rt/rust_port.cpp
@@ -1,8 +1,7 @@
 #include "rust_internal.h"
 #include "rust_port.h"
+#include "rust_chan.h"
 
-extern "C" CDECL rust_chan*
-new_chan(rust_port *port);
 
 rust_port::rust_port(rust_task *task, size_t unit_sz)
     : ref_count(1), kernel(task->kernel), task(task),
@@ -13,7 +12,8 @@ rust_port::rust_port(rust_task *task, size_t unit_sz)
         PRIxPTR, (uintptr_t)task, unit_sz, (uintptr_t)this);
 
     id = task->register_port(this);
-    remote_chan = new_chan(this);
+    remote_chan = new (task->kernel, "rust_chan")
+        rust_chan(task->kernel, this, unit_sz);
 }
 
 rust_port::~rust_port() {
diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in
index f74947be0b6..3654f67d089 100644
--- a/src/rt/rustrt.def.in
+++ b/src/rt/rustrt.def.in
@@ -30,7 +30,6 @@ last_os_error
 leak
 migrate_alloc
 nano_time
-new_chan
 new_port
 new_task
 pin_task