mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
deps: Switch from winapi
to windows_sys
in Servo code (#32516)
This is part of the switch from `winapi` to `windows-sys`. `windows-sys` is maintained by Microsoft, so is more "official." More and more crates are switching to it.
This commit is contained in:
parent
8b35c4094a
commit
e902d63732
7 changed files with 20 additions and 20 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue