File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed
branches/try/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 2
2
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5
- refs/heads/try: 89e1db3d6ce37946afd7115dfcce510261537a85
5
+ refs/heads/try: 61135080554d35cca151614c93693cb524fdffe0
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
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