pub fn memory_write_read<T>(memory: *mut T, count: usize, val: T)
where
    T: std::fmt::Display + std::fmt::Debug + PartialEq + Copy,
{
    let page_num = page_num(memory, count);
    let address = unsafe { memory.offset(count as isize) };
    info!(
        "WRITE 0x{:x} page({}) memory[{}] <- {}",
        address as u64, page_num, count, val
    );
    unsafe {
        std::ptr::write(address as *mut T, val);
    }
    let read_val = memory_read(memory, count);
    assert_eq!(val, read_val);
}
// Helper function to perform a memory write `base_address[count] = val` followed by memory read
// `base_address[count]` and print additional information.
Helper function to perform a memory write `base_address[count] = val` followed by memory read
`base_address[count]` and print additional information.
Helper function to perform a memory write ` base_address [ count ] = val ` followed by memory read ` base_address [ count ] ` and print additional information .
pub fn memory_write_read<T>(memory: *mut T, count: usize, val: T)
where
    T: std::fmt::Display + std::fmt::Debug + PartialEq + Copy,
{
    let page_num = page_num(memory, count);
    let address = unsafe { memory.offset(count as isize) };
    info!(
        "WRITE 0x{:x} page({}) memory[{}] <- {}",
        address as u64, page_num, count, val
    );
    unsafe {
        std::ptr::write(address as *mut T, val);
    }
    let read_val = memory_read(memory, count);
    assert_eq!(val, read_val);
}
pub fn memory_write_read < T > ( memory : * mut T , count : usize , val : T ) where T : std :: fmt :: Display + std :: fmt :: Debug + PartialEq + Copy , { let page_num = page_num ( memory , count ) ; let address = unsafe { memory . offset ( count as isize ) } ; info ! ( " " address as u64 page_num count val ) ; unsafe { std :: ptr :: write ( address as * mut T , val ) ; } let read_val = memory_read ( memory , count ) ; assert_eq ! ( val read_val ) ; }
Helper function to perform a memory write `base_address[count] = val` followed by memory read
`base_address[count]` and print additional information.
Helper function to perform a memory write ` base_address [ count ] = val ` followed by memory read ` base_address [ count ] ` and print additional information .
memory
*mut T
count
usize
val
T
memory
*mut T
count
usize
val
T