Skip to content

Commit

Permalink
[scudo] Reflect the allowed value for M_DECAY_TIME on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaHungDuan committed Apr 18, 2024
1 parent bab0507 commit d3c5a17
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions compiler-rt/lib/scudo/standalone/wrappers_c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d3c5a17

Please sign in to comment.