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

heap: Implement DiscardSystemPages for Fuchsia

Bug: v8:12050
Change-Id: I9fa5c0d38f277e363befbdaecaaedd4ee55bfb07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071208Reviewed-by: 's avatarWez <wez@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76160}
parent 465ca09f
......@@ -127,7 +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?
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);
DCHECK_EQ(ZX_OK, status);
return true;
}
......
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