Remove comment that is now false
This commit is contained in:
parent
bfbb7197d7
commit
6854265161
6 changed files with 40 additions and 29 deletions
|
@ -37,7 +37,7 @@ pub fn deflate_bytes(bytes: &[const u8]) -> ~[u8] {
|
||||||
ptr::addr_of(&outsz),
|
ptr::addr_of(&outsz),
|
||||||
lz_norm);
|
lz_norm);
|
||||||
assert res as int != 0;
|
assert res as int != 0;
|
||||||
let out = vec::raw::from_buf(res as *u8,
|
let out = vec::raw::from_buf_raw(res as *u8,
|
||||||
outsz as uint);
|
outsz as uint);
|
||||||
libc::free(res);
|
libc::free(res);
|
||||||
move out
|
move out
|
||||||
|
@ -55,7 +55,7 @@ pub fn inflate_bytes(bytes: &[const u8]) -> ~[u8] {
|
||||||
ptr::addr_of(&outsz),
|
ptr::addr_of(&outsz),
|
||||||
0);
|
0);
|
||||||
assert res as int != 0;
|
assert res as int != 0;
|
||||||
let out = vec::raw::from_buf(res as *u8,
|
let out = vec::raw::from_buf_raw(res as *u8,
|
||||||
outsz as uint);
|
outsz as uint);
|
||||||
libc::free(res);
|
libc::free(res);
|
||||||
move out
|
move out
|
||||||
|
|
|
@ -759,8 +759,8 @@ fn test_cant_dup_task_builder() {
|
||||||
let b = task().unlinked();
|
let b = task().unlinked();
|
||||||
do b.spawn { }
|
do b.spawn { }
|
||||||
// FIXME(#3724): For now, this is a -runtime- failure, because we haven't
|
// FIXME(#3724): For now, this is a -runtime- failure, because we haven't
|
||||||
// got move mode on self. When 3724 is fixed, this test should fail to compile
|
// got move mode on self. When 3724 is fixed, this test should fail to
|
||||||
// instead, and should go in tests/compile-fail.
|
// compile instead, and should go in tests/compile-fail.
|
||||||
do b.spawn { } // b should have been consumed by the previous call
|
do b.spawn { } // b should have been consumed by the previous call
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1657,9 +1657,22 @@ impl<T: Eq> ~[T]: MutableEqVector<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a vector from an unsafe pointer to a buffer
|
||||||
|
*
|
||||||
|
* # Arguments
|
||||||
|
*
|
||||||
|
* * ptr - An unsafe pointer to a buffer of `T`
|
||||||
|
* * elts - The number of elements in the buffer
|
||||||
|
*/
|
||||||
|
// Wrapper for fn in raw: needs to be called by net_tcp::on_tcp_read_cb
|
||||||
|
pub unsafe fn from_buf<T>(ptr: *T, elts: uint) -> ~[T] {
|
||||||
|
raw::from_buf_raw(ptr, elts)
|
||||||
|
}
|
||||||
|
|
||||||
/// Unsafe operations
|
/// Unsafe operations
|
||||||
pub mod raw {
|
mod raw {
|
||||||
// FIXME: This should have crate visibility (#1893 blocks that)
|
|
||||||
|
|
||||||
/// The internal representation of a (boxed) vector
|
/// The internal representation of a (boxed) vector
|
||||||
pub struct VecRepr {
|
pub struct VecRepr {
|
||||||
|
@ -1679,22 +1692,6 @@ pub mod raw {
|
||||||
mut len: uint
|
mut len: uint
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a vector from an unsafe pointer to a buffer
|
|
||||||
*
|
|
||||||
* # Arguments
|
|
||||||
*
|
|
||||||
* * ptr - An unsafe pointer to a buffer of `T`
|
|
||||||
* * elts - The number of elements in the buffer
|
|
||||||
*/
|
|
||||||
#[inline(always)]
|
|
||||||
pub unsafe fn from_buf<T>(ptr: *T, elts: uint) -> ~[T] {
|
|
||||||
let mut dst = with_capacity(elts);
|
|
||||||
set_len(&mut dst, elts);
|
|
||||||
as_mut_buf(dst, |p_dst, _len_dst| ptr::memcpy(p_dst, ptr, elts));
|
|
||||||
move dst
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the length of a vector
|
* Sets the length of a vector
|
||||||
*
|
*
|
||||||
|
@ -1775,6 +1772,23 @@ pub mod raw {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a vector from an unsafe pointer to a buffer
|
||||||
|
*
|
||||||
|
* # Arguments
|
||||||
|
*
|
||||||
|
* * ptr - An unsafe pointer to a buffer of `T`
|
||||||
|
* * elts - The number of elements in the buffer
|
||||||
|
*/
|
||||||
|
// Was in raw, but needs to be called by net_tcp::on_tcp_read_cb
|
||||||
|
#[inline(always)]
|
||||||
|
pub unsafe fn from_buf_raw<T>(ptr: *T, elts: uint) -> ~[T] {
|
||||||
|
let mut dst = with_capacity(elts);
|
||||||
|
set_len(&mut dst, elts);
|
||||||
|
as_mut_buf(dst, |p_dst, _len_dst| ptr::memcpy(p_dst, ptr, elts));
|
||||||
|
move dst
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies data from one vector to another.
|
* Copies data from one vector to another.
|
||||||
*
|
*
|
||||||
|
|
|
@ -190,7 +190,7 @@ impl<T: Send> &MutexARC<T> {
|
||||||
*
|
*
|
||||||
* Will additionally fail if another task has failed while accessing the arc.
|
* Will additionally fail if another task has failed while accessing the arc.
|
||||||
*/
|
*/
|
||||||
// FIXME(#2585) make this a by-move method on the arc
|
// FIXME(#3724) make this a by-move method on the arc
|
||||||
pub fn unwrap_mutex_arc<T: Send>(arc: MutexARC<T>) -> T {
|
pub fn unwrap_mutex_arc<T: Send>(arc: MutexARC<T>) -> T {
|
||||||
let MutexARC { x: x } <- arc;
|
let MutexARC { x: x } <- arc;
|
||||||
let inner = unsafe { unwrap_shared_mutable_state(move x) };
|
let inner = unsafe { unwrap_shared_mutable_state(move x) };
|
||||||
|
@ -368,7 +368,7 @@ impl<T: Const Send> &RWARC<T> {
|
||||||
* Will additionally fail if another task has failed while accessing the arc
|
* Will additionally fail if another task has failed while accessing the arc
|
||||||
* in write mode.
|
* in write mode.
|
||||||
*/
|
*/
|
||||||
// FIXME(#2585) make this a by-move method on the arc
|
// FIXME(#3724) make this a by-move method on the arc
|
||||||
pub fn unwrap_rw_arc<T: Const Send>(arc: RWARC<T>) -> T {
|
pub fn unwrap_rw_arc<T: Const Send>(arc: RWARC<T>) -> T {
|
||||||
let RWARC { x: x, _ } <- arc;
|
let RWARC { x: x, _ } <- arc;
|
||||||
let inner = unsafe { unwrap_shared_mutable_state(move x) };
|
let inner = unsafe { unwrap_shared_mutable_state(move x) };
|
||||||
|
|
|
@ -6,9 +6,7 @@ use ip = net_ip;
|
||||||
use uv::iotask;
|
use uv::iotask;
|
||||||
use uv::iotask::IoTask;
|
use uv::iotask::IoTask;
|
||||||
use future_spawn = future::spawn;
|
use future_spawn = future::spawn;
|
||||||
// FIXME #1935
|
use result::{Result};
|
||||||
// should be able to, but can't atm, replace w/ result::{result, extensions};
|
|
||||||
use result::*;
|
|
||||||
use libc::size_t;
|
use libc::size_t;
|
||||||
use io::{Reader, ReaderUtil, Writer};
|
use io::{Reader, ReaderUtil, Writer};
|
||||||
use comm = core::comm;
|
use comm = core::comm;
|
||||||
|
@ -1093,7 +1091,7 @@ extern fn on_tcp_read_cb(stream: *uv::ll::uv_stream_t,
|
||||||
log(debug, fmt!("tcp on_read_cb nread: %d", nread as int));
|
log(debug, fmt!("tcp on_read_cb nread: %d", nread as int));
|
||||||
let reader_ch = (*socket_data_ptr).reader_ch;
|
let reader_ch = (*socket_data_ptr).reader_ch;
|
||||||
let buf_base = uv::ll::get_base_from_buf(buf);
|
let buf_base = uv::ll::get_base_from_buf(buf);
|
||||||
let new_bytes = vec::raw::from_buf(buf_base, nread as uint);
|
let new_bytes = vec::from_buf(buf_base, nread as uint);
|
||||||
core::comm::send(reader_ch, result::Ok(new_bytes));
|
core::comm::send(reader_ch, result::Ok(new_bytes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,7 +233,6 @@ fn is_exported(i: ident, m: _mod) -> bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: glob-exports aren't supported yet. (#2006)
|
|
||||||
_ => ()
|
_ => ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue