diff options
author | Samson <16504129+sagudev@users.noreply.github.com> | 2024-03-11 08:58:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-11 07:58:32 +0000 |
commit | 11c16adcd184dd5bc98ad946ac05e942d335f0a3 (patch) | |
tree | f03764841ec987d3cda805d2535d3f9397d6e36d /components/allocator/lib.rs | |
parent | af3583ade88a747232fee578f1af981064da7109 (diff) | |
download | servo-11c16adcd184dd5bc98ad946ac05e942d335f0a3.tar.gz servo-11c16adcd184dd5bc98ad946ac05e942d335f0a3.zip |
Use libc::malloc_size on apple (#31602)
* Use libc::malloc_size on apple
* Unify malloc_usable_size under *mut _
Diffstat (limited to 'components/allocator/lib.rs')
-rw-r--r-- | components/allocator/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/allocator/lib.rs b/components/allocator/lib.rs index 507c0e380f6..f8faaa080e9 100644 --- a/components/allocator/lib.rs +++ b/components/allocator/lib.rs @@ -36,11 +36,11 @@ mod platform { /// Get the size of a heap block. pub unsafe extern "C" fn usable_size(ptr: *const c_void) -> usize { - #[cfg(target_os = "linux")] - return libc::malloc_usable_size(ptr as *mut _); + #[cfg(target_vendor = "apple")] + return libc::malloc_size(ptr); - #[cfg(not(target_os = "linux"))] - return libc::malloc_usable_size(ptr); + #[cfg(not(target_vendor = "apple"))] + return libc::malloc_usable_size(ptr as *mut _); } pub mod libc_compat { |