diff options
| author | Michael Bebenita <[email protected]> | 2010-08-17 23:40:07 -0700 |
|---|---|---|
| committer | Michael Bebenita <[email protected]> | 2010-08-17 23:49:57 -0700 |
| commit | 2c1ec6771bd09266308686ab13ca32e2aa73da49 (patch) | |
| tree | acbcae9da89c0f6d37fccdf8b4091f003e798683 /src/rt/rust_dom.h | |
| parent | Add a "special" rust_log flag to be used for debugging in cases where the ful... (diff) | |
| download | rust-2c1ec6771bd09266308686ab13ca32e2aa73da49.tar.xz rust-2c1ec6771bd09266308686ab13ca32e2aa73da49.zip | |
Lots of changes around memory managment in the Runtime. Added memory regions and fixed race caused by calling rust_srv::malloc() from multiple threads when sending messages.
Diffstat (limited to 'src/rt/rust_dom.h')
| -rw-r--r-- | src/rt/rust_dom.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/rt/rust_dom.h b/src/rt/rust_dom.h index 3aaf635a..d2b6e570 100644 --- a/src/rt/rust_dom.h +++ b/src/rt/rust_dom.h @@ -25,6 +25,8 @@ struct rust_dom rust_crate const *root_crate; rust_log _log; rust_srv *srv; + memory_region local_region; + memory_region synchronized_region; const char *const name; ptr_vec<rust_task> running_tasks; ptr_vec<rust_task> blocked_tasks; @@ -58,10 +60,15 @@ struct rust_dom template<typename T> void logptr(char const *msg, T* ptrval); void fail(); - void *malloc(size_t sz); - void *calloc(size_t sz); - void *realloc(void *data, size_t sz); - void free(void *p); + void *malloc(size_t size); + 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); + void *realloc(void *mem, size_t size, + memory_region::memory_region_type type); + void free(void *mem); + void free(void *mem, memory_region::memory_region_type type); void send_message(rust_message *message); void drain_incoming_message_queue(); |