Function pmem::nodrain::copy_nonoverlapping
[−]
[src]
pub unsafe fn copy_nonoverlapping<T>(src: *const T, pmemdest: *mut T, count: usize)
Copies count * size_of<T>
bytes from src
to pmemdest
. The source and destination may not overlap.
copy_nonoverlapping
is semantically equivalent to C's memcpy
and is optimized for persitent memory.
Safety
Beyond requiring that the program must be allowed to access both regions of memory,
it is Undefined Behavior for source and destination to overlap.
Care must also be taken with the ownership of src
and pmemdest
.
This method semantically moves the values of src
into pmemdest
.
However it does not drop the contents of pmemdest
, or prevent the contents of src
from being dropped or used.