Skip to content

Commit 781fffb

Browse files
committed
[scudo] Reflect the allowed value for M_DECAY_TIME on Android
1 parent c7f4b3e commit 781fffb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,11 @@ INTERFACE WEAK int SCUDO_PREFIX(mallopt)(int param, int value) {
252252
// introduced by interval transition.
253253
SCUDO_ALLOCATOR.releaseToOS(scudo::ReleaseToOS::Force);
254254

255-
if (value == 0) {
256-
// Will set the release values to their minimum values.
257-
value = INT32_MIN;
258-
} else {
259-
// Will set the release values to their maximum values.
255+
// The values allowed on Android are {-1, 0, 1}. "1" means the longest
256+
// interval.
257+
CHECK(value >= -1 && value <= 1);
258+
if (value == 1)
260259
value = INT32_MAX;
261-
}
262260
}
263261

264262
SCUDO_ALLOCATOR.setOption(scudo::Option::ReleaseInterval,

0 commit comments

Comments
 (0)