summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-06-11 18:03:45 +0000
committerbors <bors@rust-lang.org>2021-06-11 18:03:45 +0000
commit5f423a1ffd9c02bc9e1ba7da8e738520716b6674 (patch)
tree08b62fceb2dbf724bcfd5ff2ef36a5459e258429
parentdac89a3159cd5b3c712ababc131bbaedf415e4b3 (diff)
parent669bbfb82af55326b437ce5f1182ec6515e865e8 (diff)
downloadrust-libc-5f423a1ffd9c02bc9e1ba7da8e738520716b6674.tar.gz
Auto merge of #2231 - devnexen:darwin_malloc_stats, r=Amanieu
apple add few malloc debug features specifics
-rw-r--r--src/unix/bsd/apple/mod.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 5ebf95ca5a..9cfe16c7bb 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -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! {
@@ -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,