chromium/gin/v8_platform_page_allocator.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "v8_platform_page_allocator.h"

#include "base/check_op.h"
#include "base/cpu.h"
#include "base/memory/page_size.h"
#include "build/build_config.h"
#include "partition_alloc/address_space_randomization.h"
#include "partition_alloc/page_allocator_constants.h"
#include "partition_alloc/random.h"

namespace {

template <typename T>
T IfBtiEnabledOr(T enabled_value, T disabled_value) {}

// Maps the v8 page permissions into a page configuration from base.
::partition_alloc::PageAccessibilityConfiguration::Permissions
GetPagePermissions(v8::PageAllocator::Permission permission) {}

::partition_alloc::PageAccessibilityConfiguration GetPageConfig(
    v8::PageAllocator::Permission permission) {}

}  // namespace

namespace gin {
PageAllocator::~PageAllocator() = default;

size_t PageAllocator::AllocatePageSize() {}

size_t PageAllocator::CommitPageSize() {}

void PageAllocator::SetRandomMmapSeed(int64_t seed) {}

void* PageAllocator::GetRandomMmapAddr() {}

void* PageAllocator::AllocatePages(void* address,
                                   size_t length,
                                   size_t alignment,
                                   v8::PageAllocator::Permission permissions) {}

bool PageAllocator::FreePages(void* address, size_t length) {}

bool PageAllocator::ReleasePages(void* address,
                                 size_t length,
                                 size_t new_length) {}

bool PageAllocator::SetPermissions(void* address,
                                   size_t length,
                                   Permission permissions) {}

bool PageAllocator::RecommitPages(void* address,
                                  size_t length,
                                  Permission permissions) {}

bool PageAllocator::DiscardSystemPages(void* address, size_t size) {}

bool PageAllocator::DecommitPages(void* address, size_t size) {}

partition_alloc::PageAccessibilityConfiguration::Permissions
PageAllocator::GetPageConfigPermissionsForTesting(
    v8::PageAllocator::Permission permission) {}

}  // namespace gin