rt: Fix box annihilator to deallocate exchange heap boxes properly.
This commit is contained in:
parent
f8323ac615
commit
f022f566a4
@ -197,7 +197,13 @@ annihilator::do_annihilate(rust_task *task, rust_opaque_box *box) {
|
||||
annihilator annihilator(task, true, tydesc->shape,
|
||||
tydesc->shape_tables, p);
|
||||
annihilator.walk();
|
||||
task->boxed.free(box);
|
||||
// NB: A reference count of -1 indicates that this box lives on the
|
||||
// exchange heap. Otherwise it lives on the task-local heap.
|
||||
if (box->ref_count + 1 == 0) {
|
||||
task->kernel->free(box);
|
||||
} else {
|
||||
task->boxed.free(box);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user