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

Christopher Ferris via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 19:30:58 PDT 2024


================
@@ -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)
----------------
cferris1000 wrote:

That would be fine with me. We sanitize the values when coming through Android anyway, so verifying a -1, 0, or 1 is probably a better way to do this.

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


More information about the llvm-commits mailing list