rust-vmm / vm-memory

Virtual machine's guest memory crate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avoid mixing std::ptr::read/write_volatile() and std::ptr::copy()

jiangliu opened this issue · comments

The copy_slice() wrapper is used to access guest memory for most VolatileMemory methods, but there's an exception that copy_to_volatile_slice() uses std::ptr::copy(). The copy_to_volatile_slice() method should be refined to use copy_slice() so we never mix std::ptr::read/write_volatile() and std::ptr::copy()