Skip to content

Commit ca6b152

Browse files
committed
---
yaml --- r: 58326 b: refs/heads/auto c: 60803e5 h: refs/heads/master v: v3
1 parent 10157de commit ca6b152

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
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: 63c7e2f991eaf79ece0586b19f0461ec6f8933ee
17+
refs/heads/auto: 60803e5fc81ed7065c91c0b1725dbbd4da0af3f7
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/doc/tutorial-ffi.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ wrapping `malloc` and `free`:
151151
~~~~
152152
use core::libc::{c_void, size_t, malloc, free};
153153
use core::unstable::intrinsics;
154+
use core::util;
154155
155156
// a wrapper around the handle returned by the foreign code
156157
pub struct Unique<T> {
@@ -184,7 +185,8 @@ impl<T: Owned> Drop for Unique<T> {
184185
fn finalize(&self) {
185186
unsafe {
186187
let mut x = intrinsics::init(); // dummy value to swap in
187-
x <-> *self.ptr; // moving the object out is needed to call the destructor
188+
// moving the object out is needed to call the destructor
189+
util::replace_ptr(self.ptr, x);
188190
free(self.ptr as *c_void)
189191
}
190192
}

branches/auto/src/test/bench/msgsend-ring-pipes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ fn thread_ring(i: uint,
4343
// Send/Receive lots of messages.
4444
for uint::range(0, count) |j| {
4545
//error!("task %?, iter %?", i, j);
46-
let num_chan2 = replace(&mut num_chan, None);
47-
let num_port2 = replace(&mut num_port, None);
46+
let num_chan2 = util::replace(&mut num_chan, None);
47+
let num_port2 = util::replace(&mut num_port, None);
4848
num_chan = Some(ring::client::num(num_chan2.unwrap(), i * j));
4949
let port = num_port2.unwrap();
5050
match recv(port) {

0 commit comments

Comments
 (0)