From 2c1ec6771bd09266308686ab13ca32e2aa73da49 Mon Sep 17 00:00:00 2001 From: Michael Bebenita Date: Tue, 17 Aug 2010 23:40:07 -0700 Subject: 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. --- src/rt/rust_builtin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/rt/rust_builtin.cpp') diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 6b1f7d198c4..276ea5582d0 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -38,7 +38,7 @@ last_os_error(rust_task *task) { #endif size_t fill = strlen(buf) + 1; size_t alloc = next_power_of_two(sizeof(rust_str) + fill); - void *mem = dom->malloc(alloc); + void *mem = dom->malloc(alloc, memory_region::LOCAL); if (!mem) { task->fail(1); return NULL; @@ -134,7 +134,7 @@ str_alloc_with_data(rust_task *task, { rust_dom *dom = task->dom; size_t alloc = next_power_of_two(sizeof(rust_str) + n_bytes); - void *mem = dom->malloc(alloc); + void *mem = dom->malloc(alloc, memory_region::LOCAL); if (!mem) return NULL; rust_str *st = new (mem) rust_str(dom, alloc, fill, d); -- cgit 1.4.1-3-g733a5