Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apple add few malloc debug features specifics #2231

Merged
merged 1 commit into from Jun 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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