From e981abdb019689150b65d7b0b9b0990b9d21bdcc Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 20 Sep 2011 13:50:15 -0700 Subject: [PATCH] rt: Remove upcall_malloc_box and upcall_free_box; I don't think they'll be necessary after all --- src/rt/rust_upcall.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 0150cc31e48f..a0ab724818ea 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -77,25 +77,6 @@ upcall_malloc(rust_task *task, size_t nbytes, type_desc *td) { return (uintptr_t) p; } -extern "C" CDECL rust_box * -upcall_malloc_box(rust_task *task, size_t nbytes, type_desc *td) { - LOG_UPCALL_ENTRY(task); - - gc::maybe_gc(task); - - rust_box *box = reinterpret_cast - (task->malloc(nbytes + sizeof(rust_box), "tdesc", td)); - box->ref_count = 1; - box->tydesc = td; - - box->gc_prev = NULL; - if ((box->gc_next = task->gc_alloc_chain) != NULL) - box->gc_next->gc_prev = box; - task->gc_alloc_chain = box; - - return box; -} - /** * Called whenever an object's ref count drops to zero. */ @@ -110,24 +91,6 @@ upcall_free(rust_task *task, void* ptr, uintptr_t is_gc) { task->free(ptr, (bool) is_gc); } -extern "C" CDECL void -upcall_free_box(rust_task *task, rust_box *box) { - LOG_UPCALL_ENTRY(task); - - assert(!box->ref_count && "Box reference count is nonzero on free!"); - - if (box->gc_prev) - box->gc_prev->gc_next = box->gc_next; - else - task->gc_alloc_chain = box->gc_next; - if (box->gc_next) - box->gc_next->gc_prev = box->gc_prev; - - box->tydesc->drop_glue(NULL, task, (void *)box->tydesc, - box->tydesc->first_param, box->data); - task->free(box, false); -} - extern "C" CDECL uintptr_t upcall_shared_malloc(rust_task *task, size_t nbytes, type_desc *td) { LOG_UPCALL_ENTRY(task);