Skip to content

Commit

Permalink
Auto merge of #2231 - devnexen:darwin_malloc_stats, r=Amanieu
Browse files Browse the repository at this point in the history
apple add few malloc debug features specifics
  • Loading branch information
bors committed Jun 11, 2021
2 parents dac89a3 + 669bbfb commit 5f423a1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/unix/bsd/apple/mod.rs
Expand Up @@ -629,6 +629,22 @@ s! {
pub struct thread_throughput_qos_policy {
pub thread_throughput_qos_tier: thread_throughput_qos_t,
}

// malloc/malloc.h
pub struct malloc_statistics_t {
pub blocks_in_use: ::c_uint,
pub size_in_use: ::size_t,
pub max_size_in_use: ::size_t,
pub size_allocated: ::size_t,
}

pub struct mstats {
pub bytes_total: ::size_t,
pub chunks_used: ::size_t,
pub bytes_used: ::size_t,
pub chunks_free: ::size_t,
pub bytes_free: ::size_t,
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -4055,6 +4071,8 @@ extern "C" {
pub fn memset_pattern8(b: *mut ::c_void, pattern8: *const ::c_void, len: ::size_t);
pub fn memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t);

pub fn mstats() -> mstats;

pub fn proc_listpids(
t: u32,
typeinfo: u32,
Expand Down

0 comments on commit 5f423a1

Please sign in to comment.