Function pmem::ptr::copy_nooverlapping [] [src]

pub unsafe fn copy_nooverlapping<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_nooverlapping is semantically equivalent to C's memcpy and is optimized for persitent memory.

Ensures that the result has been flushed to persistence before returning.

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.