about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-06-04 22:45:46 -0700
committerBrian Anderson <banderson@mozilla.com>2012-06-05 00:21:27 -0700
commit99d6807ee009b0289d5a1ae46385d251e4f0da64 (patch)
treec176bc652adf70fcd7cc41f5cff9a165bc1cae0a /src/rt/rust_upcall.cpp
parent78fe75a7415f1073917b5202b83dad6f2ce0c2d6 (diff)
downloadrust-99d6807ee009b0289d5a1ae46385d251e4f0da64.tar.gz
rust-99d6807ee009b0289d5a1ae46385d251e4f0da64.zip
rt: Unique allocations have -1 ref count
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 21df231aee7..7a22d5016f9 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -168,7 +168,10 @@ exchange_malloc(rust_task *task, type_desc *td, uintptr_t size) {
     void *p = task->kernel->malloc(total_size, "exchange malloc");
 
     rust_opaque_box *header = static_cast<rust_opaque_box*>(p);
+    header->ref_count = -1; // This is not ref counted
     header->td = td;
+    header->prev = 0;
+    header->next = 0;
 
     memset(&header[1], '\0', body_size);