diff --git a/libc-test/semver/macos-x86_64.txt b/libc-test/semver/macos-x86_64.txt index fb2107cd04183..43de5e1f94baa 100644 --- a/libc-test/semver/macos-x86_64.txt +++ b/libc-test/semver/macos-x86_64.txt @@ -3,3 +3,4 @@ __darwin_x86_exception_state64 __darwin_x86_float_state64 __darwin_x86_thread_state64 __darwin_xmm_reg +malloc_introspection_t diff --git a/src/unix/bsd/apple/b32/mod.rs b/src/unix/bsd/apple/b32/mod.rs index 9248e3adf2853..0f1722f975744 100644 --- a/src/unix/bsd/apple/b32/mod.rs +++ b/src/unix/bsd/apple/b32/mod.rs @@ -43,6 +43,10 @@ s! { pub bh_datalen: u32, pub bh_hdrlen: ::c_ushort, } + + pub struct malloc_zone_t { + __private: [::uintptr_t; 18], // FIXME: keeping private for now + } } s_no_extra_traits! { diff --git a/src/unix/bsd/apple/b64/aarch64/mod.rs b/src/unix/bsd/apple/b64/aarch64/mod.rs index 83b62e97cf256..79e9ac842f9ca 100644 --- a/src/unix/bsd/apple/b64/aarch64/mod.rs +++ b/src/unix/bsd/apple/b64/aarch64/mod.rs @@ -1,5 +1,11 @@ pub type boolean_t = ::c_int; +s! { + pub struct malloc_zone_t { + __private: [::uintptr_t; 18], // FIXME: needs arm64 auth pointers support + } +} + cfg_if! { if #[cfg(libc_align)] { mod align; diff --git a/src/unix/bsd/apple/b64/x86_64/mod.rs b/src/unix/bsd/apple/b64/x86_64/mod.rs index 078666658ceac..2cd9cf4173c32 100644 --- a/src/unix/bsd/apple/b64/x86_64/mod.rs +++ b/src/unix/bsd/apple/b64/x86_64/mod.rs @@ -102,6 +102,74 @@ s! { pub struct __darwin_xmm_reg { pub __xmm_reg: [::c_char; 16], } + + pub struct malloc_introspection_t { + _private: [::uintptr_t; 16], // FIXME: keeping private for now + } + + pub struct malloc_zone_t { + _reserved1: *mut ::c_void, + _reserved2: *mut ::c_void, + pub size: Option ::size_t>, + pub malloc: Option *mut ::c_void>, + pub calloc: Option *mut ::c_void>, + pub valloc: Option *mut ::c_void>, + pub free: Option, + pub realloc: Option *mut ::c_void>, + pub destroy: Option, + pub zone_name: *const ::c_char, + pub batch_malloc: Option ::c_uint>, + pub batch_free: Option, + pub introspect: *mut malloc_introspection_t, + pub version: ::c_uint, + pub memalign: Option *mut ::c_void>, + pub free_definite_size: Option, + pub pressure_relief: Option ::size_t>, + pub claimed_address: Option ::boolean_t>, + } } cfg_if! { diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 4c38ded171df7..63dd83b13fb85 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -117,6 +117,8 @@ pub type vm_statistics_data_t = vm_statistics; pub type vm_statistics64_t = *mut vm_statistics64; pub type vm_statistics64_data_t = vm_statistics64; +pub type task_t = mach_port_t; + pub type sysdir_search_path_enumeration_state = ::c_uint; pub type CCStatus = i32; @@ -741,8 +743,9 @@ s! { pub bytes_free: ::size_t, } - pub struct malloc_zone_t { - __private: [::uintptr_t; 18], // FIXME: keeping private for now + pub struct vm_range_t { + pub address: ::vm_address_t, + pub size: ::vm_size_t, } // sched.h