marcel_os::memory

Function memmove

Source
#[no_mangle]
pub unsafe extern "C" fn memmove(
    dest: *mut u8,
    src: *const u8,
    num: usize,
) -> *mut u8
Expand description

Moves a block of memory from one location to another, handling overlapping regions.

This function safely moves num bytes from the source pointer src to the destination pointer dest, taking care to handle cases where the memory regions may overlap.

§Arguments

  • dest - A pointer to the destination memory block.
  • src - A pointer to the source memory block.
  • num - The number of bytes to move.

§Returns

The original destination pointer dest.

§Safety

This function is unsafe because it operates directly on raw pointers.