summary refs log tree commit diff
path: root/src/rt/rust_task.h
diff options
context:
space:
mode:
authorEric Holk <eholk@mozilla.com>2011-06-27 19:15:03 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-06-28 16:12:33 -0700
commit49a8cb34d2b6e3f7af4a7cbe842fe48ffa0245eb (patch)
treefb74a37b34ec7334f273e1bc59c18d2daf439583 /src/rt/rust_task.h
parentf6f945fed5c8d1061d80b444331910df29afa392 (diff)
downloadrust-49a8cb34d2b6e3f7af4a7cbe842fe48ffa0245eb.tar.gz
rust-49a8cb34d2b6e3f7af4a7cbe842fe48ffa0245eb.zip
Removed dom_owned, splitting things between task_owned and kernel_owned. Had to re-xfail a few tests brson recently un-xfailed.
Diffstat (limited to 'src/rt/rust_task.h')
-rw-r--r--src/rt/rust_task.h39
1 files changed, 36 insertions, 3 deletions
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h
index 62a725a98d5..5e61306af2e 100644
--- a/src/rt/rust_task.h
+++ b/src/rt/rust_task.h
@@ -9,9 +9,34 @@
 
 #include "context.h"
 
+struct stk_seg {
+    unsigned int valgrind_id;
+    uintptr_t limit;
+    uint8_t data[];
+};
+
+struct frame_glue_fns {
+    uintptr_t mark_glue_off;
+    uintptr_t drop_glue_off;
+    uintptr_t reloc_glue_off;
+};
+
+struct gc_alloc {
+    gc_alloc *prev;
+    gc_alloc *next;
+    uintptr_t ctrl_word;
+    uint8_t data[];
+    bool mark() {
+        if (ctrl_word & 1)
+            return false;
+        ctrl_word |= 1;
+        return true;
+    }
+};
+
 struct
 rust_task : public maybe_proxy<rust_task>,
-            public dom_owned<rust_task>
+            public kernel_owned<rust_task>
 {
     // Fields known to the compiler.
     stk_seg *stk;
@@ -46,8 +71,6 @@ rust_task : public maybe_proxy<rust_task>,
     // List of tasks waiting for this task to finish.
     array_list<maybe_proxy<rust_task> *> tasks_waiting_to_join;
 
-    rust_alarm alarm;
-
     rust_handle<rust_task> *handle;
 
     context ctx;
@@ -56,6 +79,9 @@ rust_task : public maybe_proxy<rust_task>,
     // or is about to run this task.
     volatile bool active;
 
+    memory_region local_region;
+    memory_region synchronized_region;
+
     // Only a pointer to 'name' is kept, so it must live as long as this task.
     rust_task(rust_dom *dom,
               rust_task_list *state,
@@ -118,6 +144,13 @@ rust_task : public maybe_proxy<rust_task>,
     rust_crate_cache * get_crate_cache();
 
     bool can_schedule();
+
+    void *malloc(size_t size, memory_region::memory_region_type type);
+    void *calloc(size_t size);
+    void *calloc(size_t size, memory_region::memory_region_type type);
+    void *realloc(void *mem, size_t size,
+        memory_region::memory_region_type type);
+    void free(void *mem, memory_region::memory_region_type type);
 };
 
 //