[scudo] -1 is also valid for M_DECAY_TIME
Test: Run tests
Change-Id: I044ef84bf0ec97c0f8cb8d3a2340b82218d85efc
diff --git a/libc/bionic/jemalloc_wrapper.cpp b/libc/bionic/jemalloc_wrapper.cpp
index a2bb1db..1bbdb29 100644
--- a/libc/bionic/jemalloc_wrapper.cpp
+++ b/libc/bionic/jemalloc_wrapper.cpp
@@ -77,9 +77,13 @@
int je_mallopt(int param, int value) {
// The only parameter we currently understand is M_DECAY_TIME.
if (param == M_DECAY_TIME) {
- // Only support setting the value to 1 or 0.
+ // Only support setting the value to -1 or 0 or 1.
ssize_t decay_time_ms;
- if (value) {
+ if (value < 0) {
+ // Given that SSIZE_MAX may not be supported in jemalloc, set this to a
+ // sufficiently large number that essentially disables the decay timer.
+ decay_time_ms = 10000000;
+ } else if (value) {
decay_time_ms = 1000;
} else {
decay_time_ms = 0;