#include <bounded-page-allocator.h>
|
| BoundedPageAllocator (v8::PageAllocator *page_allocator, Address start, size_t size, size_t allocate_page_size, PageInitializationMode page_initialization_mode, PageFreeingMode page_freeing_mode) |
|
| BoundedPageAllocator (const BoundedPageAllocator &)=delete |
|
BoundedPageAllocator & | operator= (const BoundedPageAllocator &)=delete |
|
| ~BoundedPageAllocator () override=default |
|
Address | begin () const |
|
size_t | size () const |
|
bool | contains (Address address) const |
|
size_t | AllocatePageSize () override |
|
size_t | CommitPageSize () override |
|
void | SetRandomMmapSeed (int64_t seed) override |
|
void * | GetRandomMmapAddr () override |
|
void * | AllocatePages (void *hint, size_t size, size_t alignment, Permission access) override |
|
bool | ReserveForSharedMemoryMapping (void *address, size_t size) override |
|
bool | AllocatePagesAt (Address address, size_t size, Permission access) |
|
bool | FreePages (void *address, size_t size) override |
|
bool | ReleasePages (void *address, size_t size, size_t new_size) override |
|
bool | SetPermissions (void *address, size_t size, Permission access) override |
|
bool | RecommitPages (void *address, size_t size, PageAllocator::Permission access) override |
|
bool | DiscardSystemPages (void *address, size_t size) override |
|
bool | DecommitPages (void *address, size_t size) override |
|
bool | SealPages (void *address, size_t size) override |
|
AllocationStatus | get_last_allocation_status () const |
|
virtual | ~PageAllocator ()=default |
|
virtual std::unique_ptr< SharedMemory > | AllocateSharedPages (size_t length, const void *original_address) |
|
virtual bool | CanAllocateSharedPages () |
|
Definition at line 58 of file bounded-page-allocator.h.
◆ Address
◆ AllocationStatus
Enumerator |
---|
kSuccess | |
kFailedToCommit | |
kRanOutOfReservation | |
kHintedAddressTakenOrNotFound | |
Definition at line 60 of file bounded-page-allocator.h.
◆ BoundedPageAllocator() [1/2]
◆ BoundedPageAllocator() [2/2]
◆ ~BoundedPageAllocator()
v8::base::BoundedPageAllocator::~BoundedPageAllocator |
( |
| ) |
|
|
overridedefault |
◆ AllocatePages()
void * v8::base::BoundedPageAllocator::AllocatePages |
( |
void * | address, |
|
|
size_t | length, |
|
|
size_t | alignment, |
|
|
Permission | permissions ) |
|
overridevirtual |
◆ AllocatePagesAt()
◆ AllocatePageSize()
size_t v8::base::BoundedPageAllocator::AllocatePageSize |
( |
| ) |
|
|
inlineoverridevirtual |
◆ AllocationStatusToString()
const char * v8::base::BoundedPageAllocator::AllocationStatusToString |
( |
AllocationStatus | allocation_status | ) |
|
|
static |
◆ begin()
◆ CommitPageSize()
size_t v8::base::BoundedPageAllocator::CommitPageSize |
( |
| ) |
|
|
inlineoverridevirtual |
◆ contains()
bool v8::base::BoundedPageAllocator::contains |
( |
Address | address | ) |
const |
|
inline |
◆ DecommitPages()
bool v8::base::BoundedPageAllocator::DecommitPages |
( |
void * | address, |
|
|
size_t | size ) |
|
overridevirtual |
Decommits any wired memory pages in the given range, allowing the OS to reclaim them, and marks the region as inacessible (kNoAccess). The address range stays reserved and can be accessed again later by changing its permissions. However, in that case the memory content is guaranteed to be zero-initialized again. The memory must have been previously allocated by a call to AllocatePages. Returns true on success, false otherwise.
Implements v8::PageAllocator.
Definition at line 254 of file bounded-page-allocator.cc.
◆ DiscardSystemPages()
bool v8::base::BoundedPageAllocator::DiscardSystemPages |
( |
void * | address, |
|
|
size_t | size ) |
|
overridevirtual |
Frees memory in the given [address, address + size) range. address and size should be operating system page-aligned. The next write to this memory area brings the memory transparently back. This should be treated as a hint to the OS that the pages are no longer needed. It does not guarantee that the pages will be discarded immediately or at all.
Reimplemented from v8::PageAllocator.
Definition at line 250 of file bounded-page-allocator.cc.
◆ FreePages()
bool v8::base::BoundedPageAllocator::FreePages |
( |
void * | address, |
|
|
size_t | length ) |
|
overridevirtual |
◆ get_last_allocation_status()
AllocationStatus v8::base::BoundedPageAllocator::get_last_allocation_status |
( |
| ) |
const |
|
inline |
◆ GetRandomMmapAddr()
void * v8::base::BoundedPageAllocator::GetRandomMmapAddr |
( |
| ) |
|
|
inlineoverridevirtual |
◆ operator=()
◆ RecommitPages()
Recommits discarded pages in the given range with given permissions. Discarded pages must be recommitted with their original permissions before they are used again.
Reimplemented from v8::PageAllocator.
Definition at line 238 of file bounded-page-allocator.cc.
◆ ReleasePages()
bool v8::base::BoundedPageAllocator::ReleasePages |
( |
void * | address, |
|
|
size_t | length, |
|
|
size_t | new_length ) |
|
overridevirtual |
◆ ReserveForSharedMemoryMapping()
bool v8::base::BoundedPageAllocator::ReserveForSharedMemoryMapping |
( |
void * | address, |
|
|
size_t | size ) |
|
overridevirtual |
INTERNAL ONLY: This interface has not been stabilised and may change without notice from one release to another without being deprecated first.
Reserve pages at a fixed address returning whether the reservation is possible. The reserved memory is detached from the PageAllocator and so should not be freed by it. It's intended for use with SharedMemory::RemapTo, where ~SharedMemoryMapping would free the memory.
Reimplemented from v8::PageAllocator.
Definition at line 115 of file bounded-page-allocator.cc.
◆ SealPages()
bool v8::base::BoundedPageAllocator::SealPages |
( |
void * | address, |
|
|
size_t | length ) |
|
overridevirtual |
Block any modifications to the given mapping such as changing permissions or unmapping the pages on supported platforms. The address space reservation will exist until the process ends, but it's possible to release the memory using DiscardSystemPages. Note that this might require write permissions to the page as e.g. on Linux, mseal will block discarding sealed anonymous memory.
Reimplemented from v8::PageAllocator.
Definition at line 258 of file bounded-page-allocator.cc.
◆ SetPermissions()
bool v8::base::BoundedPageAllocator::SetPermissions |
( |
void * | address, |
|
|
size_t | length, |
|
|
Permission | permissions ) |
|
overridevirtual |
◆ SetRandomMmapSeed()
void v8::base::BoundedPageAllocator::SetRandomMmapSeed |
( |
int64_t | seed | ) |
|
|
inlineoverridevirtual |
◆ size()
size_t v8::base::BoundedPageAllocator::size |
( |
| ) |
const |
◆ allocate_page_size_
const size_t v8::base::BoundedPageAllocator::allocate_page_size_ |
|
private |
◆ allocation_status_
◆ commit_page_size_
const size_t v8::base::BoundedPageAllocator::commit_page_size_ |
|
private |
◆ mutex_
◆ page_allocator_
◆ page_freeing_mode_
◆ page_initialization_mode_
◆ region_allocator_
The documentation for this class was generated from the following files: