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

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 09:55:48 PDT 2024


Author: ChiaHungDuan
Date: 2024-04-26T09:55:42-07:00
New Revision: 6904e0e8852a587b49a673055997e88855f219ea

URL: https://github.com/llvm/llvm-project/commit/6904e0e8852a587b49a673055997e88855f219ea
DIFF: https://github.com/llvm/llvm-project/commit/6904e0e8852a587b49a673055997e88855f219ea.diff

LOG: [scudo] Reflect the allowed values for M_DECAY_TIME on Android (#89114)

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/wrappers_c.inc

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/wrappers_c.inc b/compiler-rt/lib/scudo/standalone/wrappers_c.inc
index 21d5b7add51275..59f3fb0962f8b8 100644
--- a/compiler-rt/lib/scudo/standalone/wrappers_c.inc
+++ b/compiler-rt/lib/scudo/standalone/wrappers_c.inc
@@ -252,13 +252,11 @@ 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.
+      CHECK(value >= -1 && value <= 1);
+      if (value == 1)
         value = INT32_MAX;
-      }
     }
 
     SCUDO_ALLOCATOR.setOption(scudo::Option::ReleaseInterval,


        


More information about the llvm-commits mailing list