#[no_mangle]
pub extern "C" fn memset(
ptr: *mut u8,
value: u8,
num: usize,
) -> *mut u8
Expand description
Sets a block of memory to a specific value.
This function writes the value
byte to num
consecutive bytes starting from ptr
.
§Arguments
ptr
- A pointer to the start of the memory block to be filled.value
- The byte value to fill the memory block with.num
- The number of bytes to fill.
§Returns
The original pointer ptr
.
§Safety
This function is unsafe because it operates directly on raw pointers.