Add support for modifying decay timer.
Add the mallopt function, and only a single option so far.
Bug: 36401135
Test: Built and booted bullhead.
Test: Ran jemalloc unit tests.
Test: Ran bionic unit tests.
Test: Ran a test that allocated and free'd a large piece of memory,
Test: and verified that after changing the parameter, the PSS
Test: sticks around (decay timer set to 1), the PSS is purged (decay
Test: timer set to 0).
Change-Id: I6927929b0c539c1023d34772d9e26bb6a8a45877
diff --git a/libc/include/malloc.h b/libc/include/malloc.h
index 412e3f0..db5da04 100644
--- a/libc/include/malloc.h
+++ b/libc/include/malloc.h
@@ -77,6 +77,11 @@
*/
int malloc_info(int, FILE*) __INTRODUCED_IN(23);
+/* mallopt options */
+#define M_DECAY_TIME -100
+
+int mallopt(int, int) __INTRODUCED_IN(26);
+
__END_DECLS
#endif /* LIBC_INCLUDE_MALLOC_H_ */