Skip to content

Commit 26bc98a

Browse files
committed
---
yaml --- r: 15225 b: refs/heads/try c: 5747fe7 h: refs/heads/master i: 15223: d8d2709 v: v3
1 parent 39aecd3 commit 26bc98a

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 7f9ed39040404c59131ba3818e1ca947fb23d282
5+
refs/heads/try: 5747fe7a2c0df47da1e062e81988707d9209bb7e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rt/rust_task.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ cleanup_task(cleanup_args *args) {
9696
bool threw_exception = args->threw_exception;
9797
rust_task *task = a->task;
9898

99-
cc::do_cc(task);
100-
annihilate_boxes(task);
101-
cc::do_final_cc(task);
102-
103-
task->die();
104-
10599
{
106100
scoped_lock with(task->kill_lock);
107101
if (task->killed && !threw_exception) {
@@ -110,6 +104,20 @@ cleanup_task(cleanup_args *args) {
110104
}
111105
}
112106

107+
// FIXME: For performance we should do the annihilator instead
108+
// of the cycle collector even under normal termination, but
109+
// since that would hide memory management errors (like not derefing
110+
// boxes), it needs to be disableable in debug builds.
111+
if (threw_exception) {
112+
// FIXME: When the annihilator is more powerful and successfully
113+
// runs resource destructors, etc. we can get rid of this cc
114+
cc::do_cc(task);
115+
annihilate_boxes(task);
116+
}
117+
cc::do_final_cc(task);
118+
119+
task->die();
120+
113121
task->notify(!threw_exception);
114122

115123
if (threw_exception) {

0 commit comments

Comments
 (0)