#[unsafe(no_mangle)]pub unsafe extern "C" fn nstd_core_mem_copy(
dest: *mut NSTDByte,
src: *const NSTDByte,
num: NSTDUInt,
)Available on crate feature
core only.Expand description
Copies num bytes from src to dest.
§Parameters:
-
NSTDByte *dest- A pointer to the memory buffer to copysrc’s bytes to. -
const NSTDByte *src- A pointer to the memory buffer to copy from. -
NSTDUInt num- The number of bytes to copy fromsrctodest.
§Safety
This function is highly unsafe as it does not know how large either of the memory buffers are, quickly leading to undefined behavior if this function ends up reading or writing past the end of a buffer.
§Example
use nstd_sys::core::mem::nstd_core_mem_copy;
unsafe {
let buf1 = [0u8; 25];
let mut buf2 = [u8::MAX; 25];
nstd_core_mem_copy(buf2.as_mut_ptr(), buf1.as_ptr(), 25);
assert!(buf1 == buf2);
}