File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed
branches/dist-snap/src/libstd/rt Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: 89e1db3d6ce37946afd7115dfcce510261537a85
9
+ refs/heads/dist-snap: 61135080554d35cca151614c93693cb524fdffe0
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -163,10 +163,9 @@ impl<T: Send> BufferPool<T> {
163
163
164
164
fn free ( & mut self , buf : ~Buffer < T > ) {
165
165
unsafe {
166
- use cell:: Cell ;
167
- let buf = Cell :: new ( buf) ;
166
+ let mut buf = Some ( buf) ;
168
167
self . pool . with ( |pool| {
169
- let buf = buf. take ( ) ;
168
+ let buf = buf. take_unwrap ( ) ;
170
169
match pool. iter ( ) . position ( |v| v. size ( ) > buf. size ( ) ) {
171
170
Some ( i) => pool. insert ( i, buf) ,
172
171
None => pool. push ( buf) ,
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ use prelude::*;
19
19
20
20
use borrow;
21
21
use cast:: transmute;
22
- use cell:: Cell ;
23
22
use cleanup;
24
23
use libc:: { c_void, uintptr_t, c_char, size_t} ;
25
24
use local_data;
@@ -427,7 +426,6 @@ impl Coroutine {
427
426
}
428
427
429
428
fn build_start_wrapper ( start : proc ( ) ) -> proc ( ) {
430
- let start_cell = Cell :: new ( start) ;
431
429
let wrapper: proc ( ) = proc ( ) {
432
430
// First code after swap to this new context. Run our
433
431
// cleanup job.
@@ -446,6 +444,7 @@ impl Coroutine {
446
444
// need to unsafe_borrow.
447
445
let task: * mut Task = Local :: unsafe_borrow ( ) ;
448
446
447
+ let mut start_cell = Some ( start) ;
449
448
( * task) . run ( || {
450
449
// N.B. Removing `start` from the start wrapper
451
450
// closure by emptying a cell is critical for
@@ -457,7 +456,7 @@ impl Coroutine {
457
456
// be in task context. By moving `start` out of
458
457
// the closure, all the user code goes our of
459
458
// scope while the task is still running.
460
- let start = start_cell. take ( ) ;
459
+ let start = start_cell. take_unwrap ( ) ;
461
460
start ( ) ;
462
461
} ) ;
463
462
}
You can’t perform that action at this time.
0 commit comments