Skip to content

Commit 8c4f3e1

Browse files
committed
---
yaml --- r: 11481 b: refs/heads/master c: 5ee89f3 h: refs/heads/master i: 11479: 7167544 v: v3
1 parent 139a7f8 commit 8c4f3e1

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
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: acb129c5412bdc4375bb3a31a192ea6e7f26ebcc
2+
refs/heads/master: 5ee89f3f2adbc1b087820f6b929d1dbd3057a507
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rt/rust_cc.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <set>
1313
#include <vector>
1414
#include <stdint.h>
15+
#include <ios>
1516

1617
// The number of allocations Rust code performs before performing cycle
1718
// collection.
@@ -20,6 +21,8 @@
2021
// defined in rust_upcall.cpp:
2122
void upcall_s_free_shared_type_desc(type_desc *td);
2223

24+
using namespace std;
25+
2326
namespace cc {
2427

2528
// Internal reference count computation
@@ -659,6 +662,25 @@ do_cc(rust_task *task) {
659662
sweep::do_sweep(task, marked);
660663
}
661664

665+
void
666+
do_final_cc(rust_task *task) {
667+
do_cc(task);
668+
669+
boxed_region *boxed = &task->boxed;
670+
for (rust_opaque_box *box = boxed->first_live_alloc();
671+
box != NULL;
672+
box = box->next) {
673+
cerr << "Unreclaimed object found at " << (void*) box << ": ";
674+
const type_desc *td = box->td;
675+
shape::arena arena;
676+
shape::type_param *params = shape::type_param::from_tydesc(td, arena);
677+
shape::log log(task, true, td->shape, params, td->shape_tables,
678+
(uint8_t*)box_body(box), cerr);
679+
log.walk();
680+
cerr << "\n";
681+
}
682+
}
683+
662684
void
663685
maybe_cc(rust_task *task) {
664686
static debug::flag zeal("RUST_CC_ZEAL");

trunk/src/rt/rust_cc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ struct rust_task;
99
namespace cc {
1010

1111
void do_cc(rust_task *task);
12+
13+
// performs a cycle coll then asserts that there is nothing left
14+
void do_final_cc(rust_task *task);
15+
1216
void maybe_cc(rust_task *task);
1317

1418
} // end namespace cc

trunk/src/rt/rust_task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ cleanup_task(cleanup_args *args) {
149149
bool threw_exception = args->threw_exception;
150150
rust_task *task = a->task;
151151

152-
cc::do_cc(task);
152+
cc::do_final_cc(task);
153153

154154
task->die();
155155

0 commit comments

Comments
 (0)