Commit 00617dd9 authored by Bill Budge's avatar Bill Budge Committed by Commit Bot

[platform] OS::SetPermissions shouldn't fail if memory isn't reclaimed

- Changes POSIX version of OS::SetPermissions to ignore the result of
  ReclaimInaccessibleMemory instead of returning it as the result.

Bug: v8:7923
Change-Id: I70f4b81f6ccada997e2da4d4a521ffe069260bec
Reviewed-on: https://chromium-review.googlesource.com/1140678Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54619}
parent 8994347c
......@@ -354,7 +354,8 @@ bool OS::SetPermissions(void* address, size_t size, MemoryPermission access) {
int prot = GetProtectionFromMemoryPermission(access);
int ret = mprotect(address, size, prot);
if (ret == 0 && access == OS::MemoryPermission::kNoAccess) {
ret = ReclaimInaccessibleMemory(address, size);
// This is advisory; ignore errors and continue execution.
ReclaimInaccessibleMemory(address, size);
}
// For accounting purposes, we want to call MADV_FREE_REUSE on macOS after
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment