Skip to content

Commit d7e4b7d

Browse files
committed
---
yaml --- r: 59067 b: refs/heads/incoming c: 60803e5 h: refs/heads/master i: 59065: 44354d2 59063: fafc4d2 v: v3
1 parent 4a200a8 commit d7e4b7d

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
@@ -6,7 +6,7 @@ refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 63c7e2f991eaf79ece0586b19f0461ec6f8933ee
9+
refs/heads/incoming: 60803e5fc81ed7065c91c0b1725dbbd4da0af3f7
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/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/incoming/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)