Implement OS::DecommitPages on Fuchsia

Bug: chromium:1218005
Change-Id: I00168c25921fd71d925c71c7b7b9ddafd392e95e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3205901
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77237}
This commit is contained in:
Samuel Groß 2021-10-05 17:20:19 +02:00 committed by V8 LUCI CQ
parent 6fb24999b7
commit b1c2af72f6

View File

@ -134,8 +134,11 @@ bool OS::DiscardSystemPages(void* address, size_t size) {
}
bool OS::DecommitPages(void* address, size_t size) {
// TODO(chromium:1218005): support this.
return false;
// We rely on DiscardSystemPages decommitting the pages immediately (via
// ZX_VMO_OP_DECOMMIT) so that they are guaranteed to be zero-initialized
// should they be accessed again later on.
return SetPermissions(address, size, MemoryPermission::kNoAccess) &&
DiscardSystemPages(address, size);
}
// static