Skip to content

Commit 92a5dbf

Browse files
committed
---
yaml --- r: 12215 b: refs/heads/master c: 3a7a408 h: refs/heads/master i: 12213: f3c6627 12211: bc6305c 12207: 98791b5 v: v3
1 parent 869e965 commit 92a5dbf

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 106c9faa59c1a605d7e0d67da5b45d24863ec009
2+
refs/heads/master: 3a7a408386b8b1fbeb82cf6d695a168296c02793
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/mk/rt.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ RUNTIME_CS_$(1) := \
6767
rt/rust_abi.cpp \
6868
rt/rust_cc.cpp \
6969
rt/rust_debug.cpp \
70+
rt/rust_box_annihilator.cpp \
7071
rt/memory_region.cpp \
7172
rt/boxed_region.cpp \
7273
rt/arch/$$(HOST_$(1))/context.cpp

trunk/src/rt/rust_box_annihilator.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include "rust_internal.h"
2+
#include "rust_shape.h"
3+
4+
void
5+
annihilate_boxes(rust_task *task) {
6+
LOG(task, gc, "annihilating boxes for task %p", task);
7+
8+
boxed_region *boxed = &task->boxed;
9+
rust_opaque_box *box = boxed->first_live_alloc();
10+
while (box != NULL) {
11+
rust_opaque_box *tmp = box;
12+
box = box->next;
13+
boxed->free(tmp);
14+
}
15+
}

trunk/src/rt/rust_task.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,17 @@ struct cleanup_args {
8787
bool threw_exception;
8888
};
8989

90+
void
91+
annihilate_boxes(rust_task *task);
92+
9093
void
9194
cleanup_task(cleanup_args *args) {
9295
spawn_args *a = args->spargs;
9396
bool threw_exception = args->threw_exception;
9497
rust_task *task = a->task;
9598

99+
cc::do_cc(task);
100+
annihilate_boxes(task);
96101
cc::do_final_cc(task);
97102

98103
task->die();

0 commit comments

Comments
 (0)