diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-07-31 23:12:20 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-08-09 16:45:50 -0700 |
| commit | b75915d0ca20c6d066a7368ad53491a55a5a57d2 (patch) | |
| tree | d4f4a08c262940345b2cd5a1a223772f6aefb985 /src/rt/rust.cpp | |
| parent | d39255616004ea43dfabcf33b20ed2a80cd31dff (diff) | |
| download | rust-b75915d0ca20c6d066a7368ad53491a55a5a57d2.tar.gz rust-b75915d0ca20c6d066a7368ad53491a55a5a57d2.zip | |
Remove the C++ runtime. Sayonara
Diffstat (limited to 'src/rt/rust.cpp')
| -rw-r--r-- | src/rt/rust.cpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/src/rt/rust.cpp b/src/rt/rust.cpp deleted file mode 100644 index 803da32cbc8..00000000000 --- a/src/rt/rust.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -/** - * Main entry point into the Rust runtime. Here we initialize the kernel, - * create the initial scheduler and run the main task. - */ - -#include "rust_globals.h" -#include "rust_kernel.h" -#include "rust_util.h" -#include "rust_scheduler.h" -#include "rust_gc_metadata.h" - -void* global_crate_map = NULL; - -/** - The runtime entrypoint. The (C ABI) main function generated by rustc calls - `rust_start`, providing the address of the Rust ABI main function, the - platform argument vector, and a `crate_map` the provides some logging - metadata. -*/ -extern "C" CDECL int -rust_start(uintptr_t main_fn, int argc, char **argv, void* crate_map) { - - // Load runtime configuration options from the environment. - // FIXME #1497: Should provide a way to get these from the command - // line as well. - rust_env *env = load_env(argc, argv); - - global_crate_map = crate_map; - - update_gc_metadata(crate_map); - - update_log_settings(crate_map, env->logspec); - - rust_kernel *kernel = new rust_kernel(env); - - // Create the main task - rust_sched_id sched_id = kernel->main_sched_id(); - rust_scheduler *sched = kernel->get_scheduler_by_id(sched_id); - assert(sched != NULL); - rust_task *root_task = sched->create_task(NULL, "main"); - - // Schedule the main Rust task - root_task->start((spawn_fn)main_fn, NULL, NULL); - - // At this point the task lifecycle is responsible for it - // and our pointer may not be valid - root_task = NULL; - - // Run the kernel until all schedulers exit - int ret = kernel->run(); - - delete kernel; - free_env(env); - - return ret; -} - -// -// Local Variables: -// mode: C++ -// fill-column: 78; -// indent-tabs-mode: nil -// c-basic-offset: 4 -// buffer-file-coding-system: utf-8-unix -// End: -// |
