Skip to content

Commit 99d6807

Browse files
committed
rt: Unique allocations have -1 ref count
1 parent 78fe75a commit 99d6807

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rt/rust_upcall.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ exchange_malloc(rust_task *task, type_desc *td, uintptr_t size) {
168168
void *p = task->kernel->malloc(total_size, "exchange malloc");
169169

170170
rust_opaque_box *header = static_cast<rust_opaque_box*>(p);
171+
header->ref_count = -1; // This is not ref counted
171172
header->td = td;
173+
header->prev = 0;
174+
header->next = 0;
172175

173176
memset(&header[1], '\0', body_size);
174177

0 commit comments

Comments
 (0)