diff options
| author | Michael Bebenita <[email protected]> | 2010-09-07 18:39:07 -0700 |
|---|---|---|
| committer | Michael Bebenita <[email protected]> | 2010-09-07 18:44:12 -0700 |
| commit | de611a309006f0976bc9a579eb1087e7a89f79a7 (patch) | |
| tree | cd30b33ab1986c0cc84e0fc0743593bd99b0caaa /src/rt/rust_internal.h | |
| parent | Started work on a framework for writing runtime tests, added some simple test... (diff) | |
| download | rust-de611a309006f0976bc9a579eb1087e7a89f79a7.tar.xz rust-de611a309006f0976bc9a579eb1087e7a89f79a7.zip | |
Lots of design changes around proxies and message passing. Made it so that domains can only talk to other domains via handles, and with the help of the rust_kernel.
Diffstat (limited to 'src/rt/rust_internal.h')
| -rw-r--r-- | src/rt/rust_internal.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h index 60d86f61..c327f8c0 100644 --- a/src/rt/rust_internal.h +++ b/src/rt/rust_internal.h @@ -72,6 +72,11 @@ struct frame_glue_fns; #define A(dom, e, s, ...) ((e) ? (void)0 : \ (dom)->srv->fatal(#e, __FILE__, __LINE__, s, ## __VA_ARGS__)) +#define K(srv, e, s, ...) ((e) ? (void)0 : \ + srv->fatal(#e, __FILE__, __LINE__, s, ## __VA_ARGS__)) + +#define PTR "0x%" PRIxPTR + // This drives our preemption scheme. static size_t const TIME_SLICE_IN_MS = 10; @@ -96,22 +101,26 @@ template <typename T> struct rc_base { }; template <typename T> struct dom_owned { - rust_dom *get_dom() const { - return ((T*)this)->dom; - } - void operator delete(void *ptr) { ((T *)ptr)->dom->free(ptr); } }; template <typename T> struct task_owned { - rust_dom *get_dom() const { - return ((T *)this)->task->dom; + void operator delete(void *ptr) { + ((T *)ptr)->task->dom->free(ptr); } +}; +template <typename T> struct kernel_owned { void operator delete(void *ptr) { - ((T *)ptr)->task->dom->free(ptr); + ((T *)ptr)->kernel->free(ptr); + } +}; + +template <typename T> struct region_owned { + void operator delete(void *ptr) { + ((T *)ptr)->region->free(ptr); } }; @@ -152,8 +161,8 @@ public: #include "rust_srv.h" #include "rust_log.h" #include "rust_proxy.h" -#include "rust_message.h" #include "rust_kernel.h" +#include "rust_message.h" #include "rust_dom.h" #include "memory.h" @@ -552,6 +561,9 @@ struct gc_alloc { #include "rust_chan.h" #include "rust_port.h" +#include "test/rust_test_harness.h" +#include "test/rust_test_util.h" + // // Local Variables: // mode: C++ |