Skip to content

Commit be09753

Browse files
committed
---
yaml --- r: 60553 b: refs/heads/auto c: f03c9bd h: refs/heads/master i: 60551: 7905358 v: v3
1 parent 3c19c95 commit be09753

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 7ffd5233548b841b770b05a915ac6d103334c64f
17+
refs/heads/auto: f03c9bd08cde6c83306d91bb07c4810b8b8f13ba
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/clone.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ by convention implementing the `Clone` trait and calling the
2525
use core::kinds::Const;
2626

2727
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.
3130
fn clone(&self) -> Self;
3231
}
3332

@@ -86,9 +85,8 @@ clone_impl!(bool)
8685
clone_impl!(char)
8786

8887
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`.
9290
fn deep_clone(&self) -> Self;
9391
}
9492

branches/auto/src/libcore/rt/sched.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub impl Scheduler {
112112
/// to run it later. Always use this instead of pushing to the work queue
113113
/// directly.
114114
fn enqueue_task(&mut self, task: ~Coroutine) {
115-
self.work_queue.push_front(task);
115+
self.work_queue.push(task);
116116
self.event_loop.callback(resume_task_from_queue);
117117

118118
fn resume_task_from_queue() {
@@ -129,7 +129,7 @@ pub impl Scheduler {
129129
rtdebug!("looking in work queue for task to schedule");
130130

131131
let mut this = self;
132-
match this.work_queue.pop_front() {
132+
match this.work_queue.pop() {
133133
Some(task) => {
134134
rtdebug!("resuming task from work queue");
135135
this.resume_task_immediately(task);

branches/auto/src/libcore/rt/work_queue.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,21 @@ pub impl<T> WorkQueue<T> {
2323
}
2424
}
2525

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)
2828
}
2929

30-
fn pop_back(&mut self) -> Option<T> {
30+
fn pop(&mut self) -> Option<T> {
3131
if !self.queue.is_empty() {
32-
Some(self.queue.pop())
32+
Some(self.queue.shift())
3333
} else {
3434
None
3535
}
3636
}
3737

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> {
4339
if !self.queue.is_empty() {
44-
Some(self.queue.shift())
40+
Some(self.queue.pop())
4541
} else {
4642
None
4743
}

0 commit comments

Comments
 (0)