Skip to content

Commit

Permalink
fix the docstring for copy_nonoverlapping_memory
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Jun 11, 2013
1 parent 107e371 commit fbae011
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions src/libstd/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn is_null<T>(ptr: *const T) -> bool { ptr == null() }
pub fn is_not_null<T>(ptr: *const T) -> bool { !is_null(ptr) }

/**
* Copies data from one location to another
* Copies data from one location to another.
*
* Copies `count` elements (not bytes) from `src` to `dst`. The source
* and destination may overlap.
Expand All @@ -83,7 +83,7 @@ pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
}

/**
* Copies data from one location to another
* Copies data from one location to another.
*
* Copies `count` elements (not bytes) from `src` to `dst`. The source
* and destination may overlap.
Expand All @@ -95,6 +95,12 @@ pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
memmove32(dst, src as *T, count as u32);
}

/**
* Copies data from one location to another.
*
* Copies `count` elements (not bytes) from `src` to `dst`. The source
* and destination may overlap.
*/
#[inline(always)]
#[cfg(target_word_size = "64", stage0)]
pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
Expand All @@ -104,7 +110,7 @@ pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
}

/**
* Copies data from one location to another
* Copies data from one location to another.
*
* Copies `count` elements (not bytes) from `src` to `dst`. The source
* and destination may overlap.
Expand All @@ -116,6 +122,12 @@ pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
memmove64(dst, src as *T, count as u64);
}

/**
* 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)]
#[cfg(target_word_size = "32", stage0)]
pub unsafe fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: uint) {
Expand All @@ -125,11 +137,10 @@ pub unsafe fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: u
}

/**
* Copies data from one location to another. This uses memcpy instead of memmove
* to take advantage of the knowledge that the memory does not overlap.
* Copies data from one location to another.
*
* Copies `count` elements (not bytes) from `src` to `dst`. The source
* and destination may overlap.
* and destination may *not* overlap.
*/
#[inline(always)]
#[cfg(target_word_size = "32", not(stage0))]
Expand All @@ -138,6 +149,12 @@ pub unsafe fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: u
memcpy32(dst, src as *T, count as u32);
}

/**
* 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)]
#[cfg(target_word_size = "64", stage0)]
pub unsafe fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: uint) {
Expand All @@ -147,11 +164,10 @@ pub unsafe fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: u
}

/**
* Copies data from one location to another. This uses memcpy instead of memmove
* to take advantage of the knowledge that the memory does not overlap.
* Copies data from one location to another.
*
* Copies `count` elements (not bytes) from `src` to `dst`. The source
* and destination may overlap.
* and destination may *not* overlap.
*/
#[inline(always)]
#[cfg(target_word_size = "64", not(stage0))]
Expand Down

5 comments on commit fbae011

@bors
Copy link
Contributor

@bors bors commented on fbae011 Jun 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on fbae011 Jun 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging thestinger/rust/ptr = fbae011 into auto

@bors
Copy link
Contributor

@bors bors commented on fbae011 Jun 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thestinger/rust/ptr = fbae011 merged ok, testing candidate = 4a52ff0

@bors
Copy link
Contributor

@bors bors commented on fbae011 Jun 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on fbae011 Jun 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = 4a52ff0

Please sign in to comment.