Skip to content

Commit 255aa3e

Browse files
marxinAndy-Python-Programmer
authored andcommitted
Add glibc's function: malloc_stats
The function is used to report stats about glibc's memory allocator to stderr: ``` Arena 0: system bytes = 1350406144 in use bytes = 3725633952 Arena 1: system bytes = 1895907328 in use bytes = 1653748608 Total (incl. mmap): system bytes = 277286912 in use bytes = 2410356000 max mmap regions = 56 max mmap bytes = 2876198912 ```
1 parent 8deaa0d commit 255aa3e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

libc-test/semver/linux-gnu.txt

+1
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ lio_listio
643643
mallinfo
644644
mallinfo2
645645
malloc_info
646+
malloc_stats
646647
malloc_trim
647648
malloc_usable_size
648649
mallopt

src/unix/linux_like/linux/gnu/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,7 @@ extern "C" {
14261426
pub fn pthread_sigqueue(thread: ::pthread_t, sig: ::c_int, value: ::sigval) -> ::c_int;
14271427
pub fn mallinfo() -> ::mallinfo;
14281428
pub fn mallinfo2() -> ::mallinfo2;
1429+
pub fn malloc_stats();
14291430
pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int;
14301431
pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
14311432
pub fn getpwent_r(

0 commit comments

Comments
 (0)