Skip to content

Commit ce9c496

Browse files
committed
darwin add few more debug malloc zone api
1 parent 111e9fe commit ce9c496

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
@@ -1683,6 +1683,13 @@ mach_thread_self
16831683
mach_timebase_info
16841684
mach_timebase_info_data_t
16851685
madvise
1686+
malloc_statistics_t
1687+
malloc_zone_check
1688+
malloc_zone_log
1689+
malloc_zone_print
1690+
malloc_zone_print_ptr_info
1691+
malloc_zone_statistics
1692+
malloc_zone_t
16861693
max_align_t
16871694
mcontext_t
16881695
memset_pattern4
@@ -1694,6 +1701,7 @@ mkdirat
16941701
mkstemps
16951702
mount
16961703
msghdr
1704+
mstats
16971705
newlocale
16981706
nice
16991707
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! {
@@ -4062,6 +4066,11 @@ extern "C" {
40624066
pub fn memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t);
40634067

40644068
pub fn mstats() -> mstats;
4069+
pub fn malloc_zone_check(zone: *mut ::malloc_zone_t) -> ::boolean_t;
4070+
pub fn malloc_zone_print(zone: *mut ::malloc_zone_t, verbose: ::boolean_t);
4071+
pub fn malloc_zone_statistics(zone: *mut ::malloc_zone_t, stats: *mut malloc_statistics_t);
4072+
pub fn malloc_zone_log(zone: *mut ::malloc_zone_t, address: *mut ::c_void);
4073+
pub fn malloc_zone_print_ptr_info(ptr: *mut ::c_void);
40654074

40664075
pub fn proc_listpids(
40674076
t: u32,

0 commit comments

Comments
 (0)