use core::ffi::c_void;
#[inline]
#[no_mangle]
pub unsafe extern "C" fn nstd_core_mem_copy(copycat: *mut u8, other: *const u8, size: usize) {
core::ptr::copy(other, copycat, size);
}
#[inline]
#[no_mangle]
pub unsafe extern "C" fn nstd_core_mem_move(from: *mut u8, to: *mut u8, size: usize) {
nstd_core_mem_copy(to, from, size);
for i in 0..size {
(*from.add(i)) = 0;
}
}
#[inline]
#[no_mangle]
pub unsafe extern "C" fn nstd_core_mem_switch(ptr1: *mut *const c_void, ptr2: *mut *const c_void) {
let ptr3 = ptr1;
*ptr1 = *ptr2;
*ptr2 = *ptr3;
}
#[inline]
#[no_mangle]
pub unsafe extern "C" fn nstd_core_mem_fill(ptr: *mut u8, size: usize, byte: u8) {
for i in 0..size {
(*ptr.add(i)) = byte;
}
}
#[inline]
#[no_mangle]
pub unsafe extern "C" fn nstd_core_mem_zero(ptr: *mut u8, mut start: usize, end: usize) {
while start < end {
(*ptr.add(start)) = 0;
start += 1;
}
}