From 99d6807ee009b0289d5a1ae46385d251e4f0da64 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 4 Jun 2012 22:45:46 -0700 Subject: [PATCH] rt: Unique allocations have -1 ref count --- src/rt/rust_upcall.cpp | 3 +++ 1 file changed, 3 insertions(+) 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(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);