Tidy up trap-handling code.

This commit is contained in:
Dan Gohman
2018-12-19 15:12:56 -08:00
parent 4d4ecfd812
commit c4e10227de
13 changed files with 60 additions and 21 deletions

View File

@@ -130,7 +130,7 @@ impl Drop for Mmap {
if !self.ptr.is_null() {
use winapi::um::memoryapi::VirtualFree;
use winapi::um::winnt::MEM_RELEASE;
let r = unsafe { VirtualFree(self.ptr, self.len, MEM_RELEASE) };
let r = unsafe { VirtualFree(self.ptr as *mut libc::c_void, self.len, MEM_RELEASE) };
assert_eq!(r, 0);
}
}