[compiler-rt] [scudo] Reflect the allowed values for M_DECAY_TIME on Android (PR #89114)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 19:52:24 PDT 2024


https://github.com/ChiaHungDuan updated https://github.com/llvm/llvm-project/pull/89114

>From 9a16e34b92f11aa4f3a3f7d72002d72af8757356 Mon Sep 17 00:00:00 2001
From: Chia-hung Duan <chiahungduan at google.com>
Date: Wed, 17 Apr 2024 17:39:00 +0000
Subject: [PATCH] [scudo] Reflect the allowed value for M_DECAY_TIME on Android

---
 compiler-rt/lib/scudo/standalone/wrappers_c.inc | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/compiler-rt/lib/scudo/standalone/wrappers_c.inc b/compiler-rt/lib/scudo/standalone/wrappers_c.inc
index 21d5b7add51275..e256d965b626cd 100644
--- a/compiler-rt/lib/scudo/standalone/wrappers_c.inc
+++ b/compiler-rt/lib/scudo/standalone/wrappers_c.inc
@@ -252,13 +252,10 @@ INTERFACE WEAK int SCUDO_PREFIX(mallopt)(int param, int value) {
       // introduced by interval transition.
       SCUDO_ALLOCATOR.releaseToOS(scudo::ReleaseToOS::Force);
 
-      if (value == 0) {
-        // Will set the release values to their minimum values.
-        value = INT32_MIN;
-      } else {
-        // Will set the release values to their maximum values.
+      // The values allowed on Android are {-1, 0, 1}. "1" means the longest
+      // interval.
+      if (value == 1)
         value = INT32_MAX;
-      }
     }
 
     SCUDO_ALLOCATOR.setOption(scudo::Option::ReleaseInterval,



More information about the llvm-commits mailing list