File tree Expand file tree Collapse file tree 4 files changed +13
-19
lines changed
branches/auto/src/libcore Expand file tree Collapse file tree 4 files changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
14
14
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
15
15
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
16
16
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17
- refs/heads/auto: 7ffd5233548b841b770b05a915ac6d103334c64f
17
+ refs/heads/auto: f03c9bd08cde6c83306d91bb07c4810b8b8f13ba
18
18
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
19
19
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
Original file line number Diff line number Diff line change @@ -25,9 +25,8 @@ by convention implementing the `Clone` trait and calling the
25
25
use core:: kinds:: Const ;
26
26
27
27
pub trait Clone {
28
- /// Returns a copy of the value. The contents of owned pointers
29
- /// are copied to maintain uniqueness, while the contents of
30
- /// managed pointers are not copied.
28
+ /// Return a deep copy of the owned object tree. Types with shared ownership like managed boxes
29
+ /// are cloned with a shallow copy.
31
30
fn clone ( & self ) -> Self ;
32
31
}
33
32
@@ -86,9 +85,8 @@ clone_impl!(bool)
86
85
clone_impl ! ( char )
87
86
88
87
pub trait DeepClone {
89
- /// Return a deep copy of the value. Unlike `Clone`, the contents of shared pointer types
90
- /// *are* copied. Note that this is currently unimplemented for managed boxes, as
91
- /// it would need to handle cycles, but it is implemented for other smart-pointer types.
88
+ /// Return a deep copy of the object tree. Types with shared ownership are also copied via a
89
+ /// deep copy, unlike `Clone`.
92
90
fn deep_clone ( & self ) -> Self ;
93
91
}
94
92
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ pub impl Scheduler {
112
112
/// to run it later. Always use this instead of pushing to the work queue
113
113
/// directly.
114
114
fn enqueue_task ( & mut self , task : ~Coroutine ) {
115
- self . work_queue . push_front ( task) ;
115
+ self . work_queue . push ( task) ;
116
116
self . event_loop . callback ( resume_task_from_queue) ;
117
117
118
118
fn resume_task_from_queue ( ) {
@@ -129,7 +129,7 @@ pub impl Scheduler {
129
129
rtdebug ! ( "looking in work queue for task to schedule" ) ;
130
130
131
131
let mut this = self ;
132
- match this. work_queue . pop_front ( ) {
132
+ match this. work_queue . pop ( ) {
133
133
Some ( task) => {
134
134
rtdebug ! ( "resuming task from work queue" ) ;
135
135
this. resume_task_immediately ( task) ;
Original file line number Diff line number Diff line change @@ -23,25 +23,21 @@ pub impl<T> WorkQueue<T> {
23
23
}
24
24
}
25
25
26
- fn push_back ( & mut self , value : T ) {
27
- self . queue . push ( value)
26
+ fn push ( & mut self , value : T ) {
27
+ self . queue . unshift ( value)
28
28
}
29
29
30
- fn pop_back ( & mut self ) -> Option < T > {
30
+ fn pop ( & mut self ) -> Option < T > {
31
31
if !self . queue . is_empty ( ) {
32
- Some ( self . queue . pop ( ) )
32
+ Some ( self . queue . shift ( ) )
33
33
} else {
34
34
None
35
35
}
36
36
}
37
37
38
- fn push_front ( & mut self , value : T ) {
39
- self . queue . unshift ( value)
40
- }
41
-
42
- fn pop_front ( & mut self ) -> Option < T > {
38
+ fn steal ( & mut self ) -> Option < T > {
43
39
if !self . queue . is_empty ( ) {
44
- Some ( self . queue . shift ( ) )
40
+ Some ( self . queue . pop ( ) )
45
41
} else {
46
42
None
47
43
}
You can’t perform that action at this time.
0 commit comments