aboutsummaryrefslogtreecommitdiffstats
path: root/components/allocator/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/allocator/lib.rs')
-rw-r--r--components/allocator/lib.rs8
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 {