diff options
| author | Chris Peterson <cpeterson@mozilla.com> | 2013-01-14 23:36:45 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-01-18 14:38:46 -0800 |
| commit | a8ff9f2ef9fd29ef937d2d2955c2ad8ee3b4b305 (patch) | |
| tree | cccb0397f554bd8d155ffe005b562fcf7d6f74be /src/libcore/ptr.rs | |
| parent | 97b20f8e024096b903b8ec05bd39d0387d9190cb (diff) | |
| download | rust-a8ff9f2ef9fd29ef937d2d2955c2ad8ee3b4b305.tar.gz rust-a8ff9f2ef9fd29ef937d2d2955c2ad8ee3b4b305.zip | |
Rename copy_overlapping_memory() to copy_memory()
Diffstat (limited to 'src/libcore/ptr.rs')
| -rw-r--r-- | src/libcore/ptr.rs | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 17c3c11e572..513a3095292 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -26,12 +26,6 @@ use vec; #[abi = "cdecl"] extern mod libc_ { #[rust_stack] - unsafe fn memcpy(dest: *mut c_void, - src: *const c_void, - n: libc::size_t) - -> *c_void; - - #[rust_stack] unsafe fn memmove(dest: *mut c_void, src: *const c_void, n: libc::size_t) @@ -119,23 +113,10 @@ pub pure fn is_not_null<T>(ptr: *const T) -> bool { !is_null(ptr) } * Copies data from one location to another * * Copies `count` elements (not bytes) from `src` to `dst`. The source - * and destination may not overlap. - */ -#[inline(always)] -pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) { - let n = count * sys::size_of::<T>(); - libc_::memcpy(dst as *mut c_void, src as *c_void, n as size_t); -} - -/** - * Copies data from one location to another - * - * Copies `count` elements (not bytes) from `src` to `dst`. The source * and destination may overlap. */ #[inline(always)] -pub unsafe fn copy_overlapping_memory<T>(dst: *mut T, src: *const T, - count: uint) { +pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) { let n = count * sys::size_of::<T>(); libc_::memmove(dst as *mut c_void, src as *c_void, n as size_t); } @@ -146,7 +127,6 @@ pub unsafe fn set_memory<T>(dst: *mut T, c: int, count: uint) { libc_::memset(dst as *mut c_void, c as libc::c_int, n as size_t); } - /** Transform a region pointer - &T - to an unsafe pointer - *T. This is safe, but is implemented with an unsafe block due to |
