Commit 5acd927b authored by Omer Katz's avatar Omer Katz Committed by V8 LUCI CQ

Reland "heap: Implement DiscardSystemPages for Fuchsia"

This is a reland of e5d568f4

Original change's description:
> heap: Implement DiscardSystemPages for Fuchsia
>
> Bug: v8:12050
> Change-Id: I9fa5c0d38f277e363befbdaecaaedd4ee55bfb07
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071208
> Reviewed-by: Wez <wez@chromium.org>
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#76160}

Bug: v8:12050
Change-Id: I8ca9a578bc36e9f85634dfa3fba0baef6bb82579
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3081521Reviewed-by: 's avatarWez <wez@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76170}
parent 6d096131
......@@ -127,8 +127,10 @@ bool OS::SetPermissions(void* address, size_t size, MemoryPermission access) {
// static
bool OS::DiscardSystemPages(void* address, size_t size) {
// TODO(hpayer): Does Fuchsia have madvise?
return true;
uint64_t address_int = reinterpret_cast<uint64_t>(address);
zx_status_t status = zx::vmar::root_self()->op_range(
ZX_VMO_OP_DECOMMIT, address_int, size, nullptr, 0);
return status == ZX_OK;
}
// static
......
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