diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-06-27 10:08:57 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-06-27 10:08:57 -0700 |
| commit | bc9fa31618207ae71d3db9cc6eef505645cdc893 (patch) | |
| tree | ed2230a1ae0c4671e311f36f264f24e7d3702497 /src | |
| parent | 022ebc198b9e9e42880a4f3bcd31565533333296 (diff) | |
| download | rust-bc9fa31618207ae71d3db9cc6eef505645cdc893.tar.gz rust-bc9fa31618207ae71d3db9cc6eef505645cdc893.zip | |
A little tidying in rt.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rt/memory_region.h | 2 | ||||
| -rw-r--r-- | src/rt/rust.cpp | 2 | ||||
| -rw-r--r-- | src/rt/rust_dom.cpp | 18 | ||||
| -rw-r--r-- | src/rt/rust_task.cpp | 27 | ||||
| -rw-r--r-- | src/rt/rust_upcall.cpp | 2 | ||||
| -rw-r--r-- | src/rt/sync/lock_and_signal.cpp | 2 | ||||
| -rw-r--r-- | src/rt/test/rust_test_runtime.cpp | 2 |
7 files changed, 24 insertions, 31 deletions
diff --git a/src/rt/memory_region.h b/src/rt/memory_region.h index b483c60218c..381392b6af0 100644 --- a/src/rt/memory_region.h +++ b/src/rt/memory_region.h @@ -2,7 +2,7 @@ * The Rust runtime uses memory regions to provide a primitive level of * memory management and isolation between tasks, and domains. * - * TODO: Implement a custom lock-free malloc / free instead of relying solely + * FIXME: Implement a custom lock-free malloc / free instead of relying solely * on the standard malloc / free. */ diff --git a/src/rt/rust.cpp b/src/rt/rust.cpp index 62cb6fe3bf3..093656b77d2 100644 --- a/src/rt/rust.cpp +++ b/src/rt/rust.cpp @@ -79,7 +79,7 @@ int get_num_threads() if(num > 0) return num; } - // TODO: in this case, determine the number of CPUs present on the + // FIXME: in this case, determine the number of CPUs present on the // machine. return 1; } diff --git a/src/rt/rust_dom.cpp b/src/rt/rust_dom.cpp index ca3ee9c6a30..c9c6b56c09e 100644 --- a/src/rt/rust_dom.cpp +++ b/src/rt/rust_dom.cpp @@ -269,7 +269,11 @@ rust_dom::start_main_loop(int id) { scheduler_lock.lock(); // Make sure someone is watching, to pull us out of infinite loops. - //rust_timer timer(this); + // + // FIXME: time-based interruption is not presently working; worked + // in rustboot and has been completely broken in rustc. + // + // rust_timer timer(this); DLOG(this, dom, "started domain loop %d", id); @@ -332,14 +336,6 @@ rust_dom::start_main_loop(int id) { scheduled_task->rust_sp, id); - /* - // These invariants are no longer valid, as rust_sp is not - // updated. - I(this, scheduled_task->rust_sp >= - (uintptr_t) &scheduled_task->stk->data[0]); - I(this, scheduled_task->rust_sp < scheduled_task->stk->limit); - */ - reap_dead_tasks(); } @@ -371,14 +367,14 @@ rust_dom::start_main_loop(int id) { int rust_dom::start_main_loops(int num_threads) { dom_worker *worker = NULL; - + // -1, because this thread will also be a worker. for(int i = 0; i < num_threads - 1; ++i) { worker = new dom_worker(i + 1, this); worker->start(); threads.push(worker); } - + start_main_loop(0); while(threads.pop(&worker)) { diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 754ff1edaf1..21c0f593f9a 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -14,8 +14,7 @@ // FIXME (issue #151): This should be 0x300; the change here is for // practicality's sake until stack growth is working. -//static size_t const min_stk_bytes = 0x300000; -//static size_t const min_stk_bytes = 0x10000; + static size_t const min_stk_bytes = 0x100000; // Task stack segments. Heap allocated and chained together. @@ -120,7 +119,7 @@ struct spawn_args { rust_task *task; uintptr_t a3; uintptr_t a4; - void (*CDECL f)(int *, rust_task *, + void (*CDECL f)(int *, rust_task *, uintptr_t, uintptr_t); }; @@ -129,15 +128,15 @@ void task_start_wrapper(spawn_args *a) { rust_task *task = a->task; int rval = 42; - + a->f(&rval, task, a->a3, a->a4); - + LOG(task, task, "task exited with value %d", rval); { scoped_lock with(task->dom->scheduler_lock); - - // TODO: the old exit glue does some magical argument copying + + // FIXME: the old exit glue does some magical argument copying // stuff. This is probably still needed. // This is duplicated from upcall_exit, which is probably dead code by @@ -160,7 +159,7 @@ rust_task::start(uintptr_t spawnee_fn, I(dom, stk->data != NULL); I(dom, !dom->scheduler_lock.lock_held_by_current_thread()); - + scoped_lock with(dom->scheduler_lock); char *sp = (char *)rust_sp; @@ -174,7 +173,7 @@ rust_task::start(uintptr_t spawnee_fn, a->a4 = args; void **f = (void **)&a->f; *f = (void *)spawnee_fn; - + ctx.call((void *)task_start_wrapper, a, sp); yield_timer.reset(0); @@ -201,7 +200,7 @@ rust_task::yield(size_t nargs, size_t time_in_us) { LOG(this, task, "task %s @0x%" PRIxPTR " yielding for %d us", name, this, time_in_us); - // TODO: what is nargs for, and is it safe to ignore? + // FIXME: what is nargs for, and is it safe to ignore? yield_timer.reset(time_in_us); @@ -254,9 +253,9 @@ rust_task::fail(size_t nargs) { void rust_task::gc(size_t nargs) { + // FIXME: not presently implemented; was broken by rustc. DLOG(dom, task, "task %s @0x%" PRIxPTR " garbage collecting", name, this); - // run_after_return(nargs, rust_gc_glue); } void @@ -346,7 +345,7 @@ void * rust_task::malloc(size_t sz, type_desc *td) { // FIXME: GC is disabled for now. - // Effects, GC-memory classification are all wrong. + // GC-memory classification is all wrong. td = NULL; if (td) { @@ -373,7 +372,7 @@ void * rust_task::realloc(void *data, size_t sz, bool is_gc) { // FIXME: GC is disabled for now. - // Effects, GC-memory classification are all wrong. + // Effects, GC-memory classification is all wrong. is_gc = false; if (is_gc) { gc_alloc *gcm = (gc_alloc*)(((char *)data) - sizeof(gc_alloc)); @@ -397,7 +396,7 @@ void rust_task::free(void *p, bool is_gc) { // FIXME: GC is disabled for now. - // Effects, GC-memory classification are all wrong. + // GC-memory classification is all wrong. is_gc = false; if (is_gc) { gc_alloc *gcm = (gc_alloc*)(((char *)p) - sizeof(gc_alloc)); diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 885f82ddac3..022735f05dc 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -571,7 +571,7 @@ upcall_new_thread(rust_task *task, const char *name) { return child_task_proxy; } -#if 0 /* TODO: this code will be re-enabled once we have multithreading. */ +#if 0 /* FIXME: this code will be re-enabled once we have multithreading. */ #if defined(__WIN32__) static DWORD WINAPI rust_thread_start(void *ptr) diff --git a/src/rt/sync/lock_and_signal.cpp b/src/rt/sync/lock_and_signal.cpp index 93275ca3e07..f67e3ee310d 100644 --- a/src/rt/sync/lock_and_signal.cpp +++ b/src/rt/sync/lock_and_signal.cpp @@ -11,7 +11,7 @@ #if defined(__WIN32__) lock_and_signal::lock_and_signal() { - // TODO: In order to match the behavior of pthread_cond_broadcast on + // FIXME: In order to match the behavior of pthread_cond_broadcast on // Windows, we create manual reset events. This however breaks the // behavior of pthread_cond_signal, fixing this is quite involved: // refer to: http://www.cs.wustl.edu/~schmidt/win32-cv-1.html diff --git a/src/rt/test/rust_test_runtime.cpp b/src/rt/test/rust_test_runtime.cpp index 18a957edd60..cf82818c4ff 100644 --- a/src/rt/test/rust_test_runtime.cpp +++ b/src/rt/test/rust_test_runtime.cpp @@ -1,11 +1,9 @@ #include "rust_test_runtime.h" rust_test_runtime::rust_test_runtime() { - // TODO Auto-generated constructor stub } rust_test_runtime::~rust_test_runtime() { - // TODO Auto-generated destructor stub } #define DOMAINS 32 |
