diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-02-01 18:50:19 -0800 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-02-01 18:50:19 -0800 |
| commit | 31166438063236e6d2ad021cf2169fce2b3839b4 (patch) | |
| tree | c42edd27f47c8a78cc212391c093992d3bde7f4b /src/rt/rust_builtin.cpp | |
| parent | c36207bfb82f794f17fc5854d4ae50284eddf329 (diff) | |
| download | rust-31166438063236e6d2ad021cf2169fce2b3839b4.tar.gz rust-31166438063236e6d2ad021cf2169fce2b3839b4.zip | |
Revert "make boxes self-describing (fixes #1493)" until a new
snapshot is prepared.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index ea2e8de256c..89d8c6d12f2 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -429,6 +429,22 @@ start_task(rust_task_id id, fn_env_pair *f) { target->deref(); } +extern "C" CDECL void +migrate_alloc(void *alloc, rust_task_id tid) { + rust_task *task = rust_scheduler::get_task(); + if(!alloc) return; + rust_task *target = task->kernel->get_task_by_id(tid); + if(target) { + const type_desc *tydesc = task->release_alloc(alloc); + target->claim_alloc(alloc, tydesc); + target->deref(); + } + else { + // We couldn't find the target. Maybe we should just free? + task->fail(); + } +} + extern "C" CDECL int sched_threads() { rust_task *task = rust_scheduler::get_task(); |
