Skip to content

Commit 4d4f150

Browse files
committed
Auto merge of #2249 - devnexen:malloc_zone_apple, r=Amanieu
darwin add few more debug malloc zone api
2 parents 2fe359b + ce9c496 commit 4d4f150

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

libc-test/semver/apple.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,13 @@ mach_thread_self
16841684
mach_timebase_info
16851685
mach_timebase_info_data_t
16861686
madvise
1687+
malloc_statistics_t
1688+
malloc_zone_check
1689+
malloc_zone_log
1690+
malloc_zone_print
1691+
malloc_zone_print_ptr_info
1692+
malloc_zone_statistics
1693+
malloc_zone_t
16871694
max_align_t
16881695
mcontext_t
16891696
memset_pattern4
@@ -1695,6 +1702,7 @@ mkdirat
16951702
mkstemps
16961703
mount
16971704
msghdr
1705+
mstats
16981706
newlocale
16991707
nice
17001708
nl_item

src/unix/bsd/apple/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,10 @@ s! {
645645
pub chunks_free: ::size_t,
646646
pub bytes_free: ::size_t,
647647
}
648+
649+
pub struct malloc_zone_t {
650+
__private: [::uintptr_t; 18], // FIXME: keeping private for now
651+
}
648652
}
649653

650654
s_no_extra_traits! {
@@ -4066,6 +4070,11 @@ extern "C" {
40664070
pub fn memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t);
40674071

40684072
pub fn mstats() -> mstats;
4073+
pub fn malloc_zone_check(zone: *mut ::malloc_zone_t) -> ::boolean_t;
4074+
pub fn malloc_zone_print(zone: *mut ::malloc_zone_t, verbose: ::boolean_t);
4075+
pub fn malloc_zone_statistics(zone: *mut ::malloc_zone_t, stats: *mut malloc_statistics_t);
4076+
pub fn malloc_zone_log(zone: *mut ::malloc_zone_t, address: *mut ::c_void);
4077+
pub fn malloc_zone_print_ptr_info(ptr: *mut ::c_void);
40694078

40704079
pub fn proc_listpids(
40714080
t: u32,

0 commit comments

Comments
 (0)