diff options
Diffstat (limited to 'components/allocator/lib.rs')
-rw-r--r-- | components/allocator/lib.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/allocator/lib.rs b/components/allocator/lib.rs index c572f9e552e..aa7f6b1e99a 100644 --- a/components/allocator/lib.rs +++ b/components/allocator/lib.rs @@ -61,7 +61,8 @@ mod platform { pub use std::alloc::System as Allocator; use std::os::raw::c_void; - use winapi::um::heapapi::{GetProcessHeap, HeapSize, HeapValidate}; + use windows_sys::Win32::Foundation::FALSE; + use windows_sys::Win32::System::Memory::{GetProcessHeap, HeapSize, HeapValidate}; /// Get the size of a heap block. /// @@ -71,8 +72,8 @@ mod platform { pub unsafe extern "C" fn usable_size(mut ptr: *const c_void) -> usize { let heap = GetProcessHeap(); - if HeapValidate(heap, 0, ptr) == 0 { - ptr = *(ptr as *const *const c_void).offset(-1); + if HeapValidate(heap, 0, ptr) == FALSE { + ptr = *(ptr as *const *const c_void).offset(-1) } HeapSize(heap, 0, ptr) as usize |