Skip to content

Commit 4d4d040

Browse files
committed
---
yaml --- r: 140690 b: refs/heads/try2 c: 60803e5 h: refs/heads/master v: v3
1 parent 17fc4d5 commit 4d4d040

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 63c7e2f991eaf79ece0586b19f0461ec6f8933ee
8+
refs/heads/try2: 60803e5fc81ed7065c91c0b1725dbbd4da0af3f7
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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