about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp73
1 files changed, 0 insertions, 73 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 28a8e0a4716..dfeeda34994 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -288,79 +288,6 @@ upcall_shared_realloc(void *ptr, size_t size) {
     return args.retval;
 }
 
-/**********************************************************************
- * Called to deep copy a type descriptor onto the exchange heap.
- * Used when sending closures.  It's possible that we should have
- * a central hashtable to avoid copying and re-copying the same 
- * type descriptors.
- */
-
-struct s_create_shared_type_desc_args {
-    const type_desc *td;
-    type_desc *res;
-};
-
-void upcall_s_create_shared_type_desc(s_create_shared_type_desc_args *args)
-{
-    rust_task *task = rust_task_thread::get_task();
-    LOG_UPCALL_ENTRY(task);
-
-    // Copy the main part of the type descriptor:
-    const type_desc *td = args->td;
-    int n_params = td->n_params;
-    size_t sz = sizeof(type_desc) + sizeof(type_desc*) * (n_params+1);
-    args->res = (type_desc*) task->kernel->malloc(sz, "create_shared_type_desc");
-    memcpy(args->res, td, sizeof(type_desc));
-
-    // Recursively copy any referenced descriptors:
-    if (n_params == 0) {
-        args->res->first_param = NULL;
-    } else {
-        args->res->first_param = &args->res->descs[1];
-        args->res->descs[0] = args->res;
-        for (int i = 0; i < n_params; i++) {
-            s_create_shared_type_desc_args rec_args = {
-                td->first_param[i], 0
-            };
-            upcall_s_create_shared_type_desc(&rec_args);
-            args->res->first_param[i] = rec_args.res;
-        }
-    }
-}
-
-extern "C" CDECL type_desc *
-upcall_create_shared_type_desc(type_desc *td) {
-    s_create_shared_type_desc_args args = { td, 0 };
-    UPCALL_SWITCH_STACK(&args, upcall_s_create_shared_type_desc);
-    return args.res;
-}
-
-/**********************************************************************
- * Called to deep free a type descriptor from the exchange heap.
- */
-
-void upcall_s_free_shared_type_desc(type_desc *td)
-{ // n.b.: invoked from rust_cc.cpp as well as generated code
-    rust_task *task = rust_task_thread::get_task();
-    LOG_UPCALL_ENTRY(task);
-
-    if (td) {
-        // Recursively free any referenced descriptors:
-        for (unsigned i = 0; i < td->n_params; i++) {
-            upcall_s_free_shared_type_desc((type_desc*) td->first_param[i]);
-        }
-
-        task->kernel->free(td);
-    }
-}
-
-extern "C" CDECL void
-upcall_free_shared_type_desc(type_desc *td) {
-    if (td) {
-        UPCALL_SWITCH_STACK(td, upcall_s_free_shared_type_desc);
-    }
-}
-
 /**********************************************************************/
 
 struct s_vec_grow_args {