mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: replace as <pointer> casts with safer alternatives
`as` casts can change mutability, which quickly leads to undefined behavior. Signed-off-by: Julian Schindel <mail@arctic-alpaca.de>
This commit is contained in:
committed by
Rob Bradford
parent
8b101fb890
commit
ae7113e1d4
@@ -480,7 +480,7 @@ impl MemEpollHandler {
|
||||
// alone is not past the end.
|
||||
let res = unsafe {
|
||||
libc::madvise(
|
||||
self.region.as_ptr().offset(offset as isize) as *mut libc::c_void,
|
||||
self.region.as_ptr().offset(offset as isize).cast(),
|
||||
size as libc::size_t,
|
||||
libc::MADV_DONTNEED,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user