diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-10-16 18:34:01 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-10-17 17:31:35 -0700 |
| commit | 34d376f3cf234dc714fcfab7639affd3967dc16d (patch) | |
| tree | 780dbbd084e9a57689e2565a2e1b3541a350eb86 /src/libstd/rt | |
| parent | 3fd0e3a77be624f41647bb930843de27bc1cc985 (diff) | |
| download | rust-34d376f3cf234dc714fcfab7639affd3967dc16d.tar.gz rust-34d376f3cf234dc714fcfab7639affd3967dc16d.zip | |
std: Move size/align functions to std::mem. #2240
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/context.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/global_heap.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/io/native/process.rs | 4 | ||||
| -rw-r--r-- | src/libstd/rt/sched.rs | 4 | ||||
| -rw-r--r-- | src/libstd/rt/test.rs | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/src/libstd/rt/context.rs b/src/libstd/rt/context.rs index 853cc08a0ba..222f9a44b17 100644 --- a/src/libstd/rt/context.rs +++ b/src/libstd/rt/context.rs @@ -233,6 +233,6 @@ fn align_down(sp: *mut uint) -> *mut uint { // ptr::mut_offset is positive ints only #[inline] pub fn mut_offset<T>(ptr: *mut T, count: int) -> *mut T { - use std::sys::size_of; + use mem::size_of; (ptr as int + count * (size_of::<T>() as int)) as *mut T } diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs index 7d3f5f91774..446efbd9047 100644 --- a/src/libstd/rt/global_heap.rs +++ b/src/libstd/rt/global_heap.rs @@ -11,7 +11,7 @@ use libc::{c_void, c_char, size_t, uintptr_t, free, malloc, realloc}; use unstable::intrinsics::TyDesc; use unstable::raw; -use sys::size_of; +use mem::size_of; extern { #[rust_stack] diff --git a/src/libstd/rt/io/native/process.rs b/src/libstd/rt/io/native/process.rs index d338192c664..57367beacd8 100644 --- a/src/libstd/rt/io/native/process.rs +++ b/src/libstd/rt/io/native/process.rs @@ -271,12 +271,12 @@ fn spawn_process_os(prog: &str, args: &[~str], }; use libc::funcs::extra::msvcrt::get_osfhandle; - use sys; + use mem; unsafe { let mut si = zeroed_startupinfo(); - si.cb = sys::size_of::<STARTUPINFO>() as DWORD; + si.cb = mem::size_of::<STARTUPINFO>() as DWORD; si.dwFlags = STARTF_USESTDHANDLES; let cur_proc = GetCurrentProcess(); diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs index 0a4622bc65e..7724f58153e 100644 --- a/src/libstd/rt/sched.rs +++ b/src/libstd/rt/sched.rs @@ -857,7 +857,7 @@ fn new_sched_rng() -> XorShiftRng { #[fixed_stack_segment] #[inline(never)] fn new_sched_rng() -> XorShiftRng { use libc; - use sys; + use mem; use c_str::ToCStr; use vec::MutableVector; use iter::Iterator; @@ -871,7 +871,7 @@ fn new_sched_rng() -> XorShiftRng { } let mut seeds = [0u32, .. 4]; - let size = sys::size_of_val(&seeds); + let size = mem::size_of_val(&seeds); loop { let nbytes = do seeds.as_mut_buf |buf, _| { unsafe { diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs index 1178bfdaa80..9f4e6558ac5 100644 --- a/src/libstd/rt/test.rs +++ b/src/libstd/rt/test.rs @@ -103,7 +103,7 @@ mod darwin_fd_limit { // The strategy here is to fetch the current resource limits, read the kern.maxfilesperproc // sysctl value, and bump the soft resource limit for maxfiles up to the sysctl value. use ptr::{to_unsafe_ptr, to_mut_unsafe_ptr, mut_null}; - use sys::size_of_val; + use mem::size_of_val; use os::last_os_error; // Fetch the kern.maxfilesperproc value |
