mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Use libc::malloc_size on apple (#31602)
* Use libc::malloc_size on apple * Unify malloc_usable_size under *mut _
This commit is contained in:
parent
af3583ade8
commit
11c16adcd1
1 changed files with 4 additions and 4 deletions
|
@ -36,11 +36,11 @@ mod platform {
|
||||||
|
|
||||||
/// Get the size of a heap block.
|
/// Get the size of a heap block.
|
||||||
pub unsafe extern "C" fn usable_size(ptr: *const c_void) -> usize {
|
pub unsafe extern "C" fn usable_size(ptr: *const c_void) -> usize {
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_vendor = "apple")]
|
||||||
return libc::malloc_usable_size(ptr as *mut _);
|
return libc::malloc_size(ptr);
|
||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_vendor = "apple"))]
|
||||||
return libc::malloc_usable_size(ptr);
|
return libc::malloc_usable_size(ptr as *mut _);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod libc_compat {
|
pub mod libc_compat {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue