aboutsummaryrefslogtreecommitdiffstats
path: root/libc/include/malloc.h
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-08-20 09:16:57 -0700
committerDan Albert <danalbert@google.com>2014-08-22 10:23:12 -0700
commit4caa1f09770ea3e5ca22afbe8aa0900810a0dbfe (patch)
tree2bda183c2c930871e73486ea3e9c54e80e500f95 /libc/include/malloc.h
parentd5fbc37119ef6cd757ceb449cb071ee03c66590e (diff)
downloadandroid_bionic-4caa1f09770ea3e5ca22afbe8aa0900810a0dbfe.tar.gz
android_bionic-4caa1f09770ea3e5ca22afbe8aa0900810a0dbfe.tar.bz2
android_bionic-4caa1f09770ea3e5ca22afbe8aa0900810a0dbfe.zip
Implement malloc_info(3).
Expose jemalloc stats through the malloc_info(3) interface. Bug: 16874689 Change-Id: I4358ac283002e60ff161107028d1a3fb1e9afb0a
Diffstat (limited to 'libc/include/malloc.h')
-rw-r--r--libc/include/malloc.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/libc/include/malloc.h b/libc/include/malloc.h
index e6ea27606..cb1dd3bcf 100644
--- a/libc/include/malloc.h
+++ b/libc/include/malloc.h
@@ -24,6 +24,7 @@
*/
#include <sys/cdefs.h>
#include <stddef.h>
+#include <stdio.h>
__BEGIN_DECLS
@@ -53,6 +54,27 @@ struct mallinfo {
extern struct mallinfo mallinfo(void);
+/*
+ * XML structure for malloc_info(3) is in the following format:
+ *
+ * <malloc version="jemalloc-1">
+ * <heap nr="INT">
+ * <allocated-large>INT</allocated-large>
+ * <allocated-huge>INT</allocated-huge>
+ * <allocated-bins>INT</allocated-bins>
+ * <bins-total>INT</bins-total>
+ * <bin nr="INT">
+ * <allocated>INT</allocated>
+ * <nmalloc>INT</nmalloc>
+ * <ndalloc>INT</ndalloc>
+ * </bin>
+ * <!-- more bins -->
+ * </heap>
+ * <!-- more heaps -->
+ * </malloc>
+ */
+extern int malloc_info(int, FILE *);
+
__END_DECLS
#endif /* LIBC_INCLUDE_MALLOC_H_ */