aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-08-17 23:40:07 -0700
committerMichael Bebenita <[email protected]>2010-08-17 23:49:57 -0700
commit2c1ec6771bd09266308686ab13ca32e2aa73da49 (patch)
treeacbcae9da89c0f6d37fccdf8b4091f003e798683 /src/rt/rust_builtin.cpp
parentAdd a "special" rust_log flag to be used for debugging in cases where the ful... (diff)
downloadrust-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_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 6b1f7d19..276ea558 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);