File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
branches/dist-snap/src/libcore Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
9
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10
- refs/heads/dist-snap: 4999d44d5b244671492fbdc05121416e05f729eb
10
+ refs/heads/dist-snap: cc62680cc95d2ea733dbdc03c30e5c4c48fdad04
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
13
13
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ use ptr::mut_null;
15
15
use repr:: BoxRepr ;
16
16
use sys:: TypeDesc ;
17
17
use cast:: transmute;
18
+ use unstable:: lang:: clear_task_borrow_list;
18
19
19
20
#[ cfg( notest) ] use ptr:: to_unsafe_ptr;
20
21
@@ -179,6 +180,10 @@ pub unsafe fn annihilate() {
179
180
n_bytes_freed : 0
180
181
} ;
181
182
183
+ // Quick hack: we need to free this list upon task exit, and this
184
+ // is a convenient place to do it.
185
+ clear_task_borrow_list ( ) ;
186
+
182
187
// Pass 1: Make all boxes immortal.
183
188
//
184
189
// In this pass, nothing gets freed, so it does not matter whether
Original file line number Diff line number Diff line change @@ -91,7 +91,16 @@ fn swap_task_borrow_list(f: &fn(~[BorrowRecord]) -> ~[BorrowRecord]) {
91
91
}
92
92
}
93
93
94
- pub fn fail_borrowed ( box : * mut BoxRepr , file : * c_char , line : size_t ) {
94
+ pub unsafe fn clear_task_borrow_list ( ) {
95
+ // pub because it is used by the box annihilator.
96
+ let cur_task = rust_get_task ( ) ;
97
+ let ptr = rustrt:: rust_take_task_borrow_list ( cur_task) ;
98
+ if !ptr. is_null ( ) {
99
+ let _: ~[ BorrowRecord ] = transmute ( ptr) ;
100
+ }
101
+ }
102
+
103
+ fn fail_borrowed ( box : * mut BoxRepr , file : * c_char , line : size_t ) {
95
104
debug_ptr ( "fail_borrowed: " , box) ;
96
105
97
106
if !:: rt:: env:: get ( ) . debug_borrows {
You can’t perform that action at this time.
0 commit comments