diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-01-13 16:53:13 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-02-06 14:27:36 -0800 |
| commit | e43c5bdc6b47e8dd5e2ddcd6cf57fec79388523a (patch) | |
| tree | 309c89fe29131346dc5e258e2dd948c381ec256d /src/rt/rust_upcall.cpp | |
| parent | e91040c704aa9ab46fb1c7a10e293fd5f6bfe079 (diff) | |
| download | rust-e43c5bdc6b47e8dd5e2ddcd6cf57fec79388523a.tar.gz rust-e43c5bdc6b47e8dd5e2ddcd6cf57fec79388523a.zip | |
Rewrite the exchange allocator to work without an active scheduler. #4457
Diffstat (limited to 'src/rt/rust_upcall.cpp')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index ea396146755..008b470fede 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -141,81 +141,6 @@ struct s_trace_args { }; /********************************************************************** - * Allocate an object in the exchange heap - */ - -struct s_exchange_malloc_args { - rust_task *task; - uintptr_t retval; - type_desc *td; - uintptr_t size; -}; - -extern "C" CDECL void -upcall_s_exchange_malloc(s_exchange_malloc_args *args) { - rust_task *task = args->task; - LOG_UPCALL_ENTRY(task); - - size_t total_size = get_box_size(args->size, args->td->align); - void *p = task->kernel->malloc(total_size, "exchange malloc"); - - rust_opaque_box *header = static_cast<rust_opaque_box*>(p); - header->ref_count = -1; // This is not ref counted - header->td = args->td; - header->prev = 0; - header->next = 0; - - LOG(task, mem, "exchange malloced %p of size %" PRIuPTR, - header, args->size); - - args->retval = (uintptr_t)header; -} - -extern "C" CDECL uintptr_t -upcall_exchange_malloc(type_desc *td, uintptr_t size) { - rust_task *task = rust_get_current_task(); - s_exchange_malloc_args args = {task, 0, td, size}; - UPCALL_SWITCH_STACK(task, &args, upcall_s_exchange_malloc); - return args.retval; -} - -// FIXME (#2861): Alias used by libcore/rt.rs to avoid naming conflicts with -// autogenerated wrappers for upcall_exchange_malloc. Remove this when we -// fully move away away from the C upcall path. -extern "C" CDECL uintptr_t -rust_upcall_exchange_malloc(type_desc *td, uintptr_t size) { - return upcall_exchange_malloc(td, size); -} - -struct s_exchange_free_args { - rust_task *task; - void *ptr; -}; - -extern "C" CDECL void -upcall_s_exchange_free(s_exchange_free_args *args) { - rust_task *task = args->task; - LOG_UPCALL_ENTRY(task); - LOG(task, mem, "exchange freed %p", args->ptr); - task->kernel->free(args->ptr); -} - -extern "C" CDECL void -upcall_exchange_free(void *ptr) { - rust_task *task = rust_get_current_task(); - s_exchange_free_args args = {task,ptr}; - UPCALL_SWITCH_STACK(task, &args, upcall_s_exchange_free); -} - -// FIXME (#2861): Alias used by libcore/rt.rs to avoid naming conflicts with -// autogenerated wrappers for upcall_exchange_free. Remove this when we fully -// move away away from the C upcall path. -extern "C" CDECL void -rust_upcall_exchange_free(void *ptr) { - return upcall_exchange_free(ptr); -} - -/********************************************************************** * Allocate an object in the task-local heap. */ |
