@@ -471,20 +471,20 @@ pub fn shift<T>(v: &mut ~[T]) -> T unsafe {
471471 // We still should have room to work where what last element was
472472 assert capacity( v) >= ln;
473473 // Pretend like we have the original length so we can use
474- // the vector memcpy to overwrite the hole we just made
474+ // the vector copy_memory to overwrite the hole we just made
475475 raw:: set_len ( v, ln) ;
476476
477477 // Memcopy the head element (the one we want) to the location we just
478478 // popped. For the moment it unsafely exists at both the head and last
479479 // positions
480480 let first_slice = view ( * v, 0 , 1 ) ;
481481 let last_slice = mut_view ( * v, next_ln, ln) ;
482- raw:: memcpy ( last_slice, first_slice, 1 ) ;
482+ raw:: copy_memory ( last_slice, first_slice, 1 ) ;
483483
484484 // Memcopy everything to the left one element
485485 let init_slice = mut_view ( * v, 0 , next_ln) ;
486486 let tail_slice = view ( * v, 1 , ln) ;
487- raw:: memcpy ( init_slice, tail_slice, next_ln) ;
487+ raw:: copy_memory ( init_slice, tail_slice, next_ln) ;
488488
489489 // Set the new length. Now the vector is back to normal
490490 raw:: set_len ( v, next_ln) ;
@@ -2075,7 +2075,7 @@ pub mod raw {
20752075 pub unsafe fn from_buf_raw < T > ( ptr : * T , elts : uint ) -> ~[ T ] {
20762076 let mut dst = with_capacity ( elts) ;
20772077 set_len ( & mut dst, elts) ;
2078- as_mut_buf ( dst, |p_dst, _len_dst| ptr:: memcpy ( p_dst, ptr, elts) ) ;
2078+ as_mut_buf ( dst, |p_dst, _len_dst| ptr:: copy_memory ( p_dst, ptr, elts) ) ;
20792079 dst
20802080 }
20812081
@@ -2085,13 +2085,13 @@ pub mod raw {
20852085 * Copies `count` bytes from `src` to `dst`. The source and destination
20862086 * may overlap.
20872087 */
2088- pub unsafe fn memcpy < T > ( dst : & [ mut T ] , src : & [ const T ] , count : uint ) {
2088+ pub unsafe fn copy_memory < T > ( dst : & [ mut T ] , src : & [ const T ] , count : uint ) {
20892089 assert dst. len ( ) >= count;
20902090 assert src. len ( ) >= count;
20912091
20922092 do as_mut_buf( dst) |p_dst, _len_dst| {
20932093 do as_const_buf ( src) |p_src, _len_src| {
2094- ptr:: memcpy ( p_dst, p_src, count)
2094+ ptr:: copy_memory ( p_dst, p_src, count)
20952095 }
20962096 }
20972097 }
@@ -2102,13 +2102,13 @@ pub mod raw {
21022102 * Copies `count` bytes from `src` to `dst`. The source and destination
21032103 * may overlap.
21042104 */
2105- pub unsafe fn memmove < T > ( dst : & [ mut T ] , src : & [ const T ] , count : uint ) {
2105+ pub unsafe fn copy_overlapping_memory < T > ( dst : & [ mut T ] , src : & [ const T ] , count : uint ) {
21062106 assert dst. len ( ) >= count;
21072107 assert src. len ( ) >= count;
21082108
21092109 do as_mut_buf( dst) |p_dst, _len_dst| {
21102110 do as_const_buf ( src) |p_src, _len_src| {
2111- ptr:: memmove ( p_dst, p_src, count)
2111+ ptr:: copy_overlapping_memory ( p_dst, p_src, count)
21122112 }
21132113 }
21142114 }
@@ -2167,9 +2167,9 @@ pub mod bytes {
21672167 * Copies `count` bytes from `src` to `dst`. The source and destination
21682168 * may not overlap.
21692169 */
2170- pub fn memcpy ( dst : & [ mut u8] , src : & [ const u8 ] , count : uint ) {
2171- // Bound checks are done at vec::raw::memcpy .
2172- unsafe { vec:: raw:: memcpy ( dst, src, count) }
2170+ pub fn copy_memory ( dst : & [ mut u8] , src : & [ const u8 ] , count : uint ) {
2171+ // Bound checks are done at vec::raw::copy_memory .
2172+ unsafe { vec:: raw:: copy_memory ( dst, src, count) }
21732173 }
21742174
21752175 /**
@@ -2178,9 +2178,9 @@ pub mod bytes {
21782178 * Copies `count` bytes from `src` to `dst`. The source and destination
21792179 * may overlap.
21802180 */
2181- pub fn memmove ( dst : & [ mut u8] , src : & [ const u8 ] , count : uint ) {
2182- // Bound checks are done at vec::raw::memmove .
2183- unsafe { vec:: raw:: memmove ( dst, src, count) }
2181+ pub fn copy_overlapping_memory ( dst : & [ mut u8] , src : & [ const u8 ] , count : uint ) {
2182+ // Bound checks are done at vec::raw::copy_overlapping_memory .
2183+ unsafe { vec:: raw:: copy_overlapping_memory ( dst, src, count) }
21842184 }
21852185}
21862186
@@ -3896,10 +3896,10 @@ mod tests {
38963896 #[ test]
38973897 #[ should_fail]
38983898 #[ ignore( cfg( windows) ) ]
3899- fn test_memcpy_oob ( ) unsafe {
3899+ fn test_copy_memory_oob ( ) unsafe {
39003900 let a = [ mut 1 , 2 , 3 , 4 ] ;
39013901 let b = [ 1 , 2 , 3 , 4 , 5 ] ;
3902- raw:: memcpy ( a, b, 5 ) ;
3902+ raw:: copy_memory ( a, b, 5 ) ;
39033903 }
39043904
39053905}
0 commit comments