V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
v8::base::BoundedPageAllocator Class Reference
Inheritance diagram for v8::base::BoundedPageAllocator:
v8::PageAllocator

Public Types

typedef uintptr_t Address
 
- Public Types inherited from v8::PageAllocator
enum  Permission {
  kNoAccess, kRead, kReadWrite, kReadWriteExecute,
  kReadExecute
}
 

Public Member Functions

 BoundedPageAllocator (v8::PageAllocator *page_allocator, Address start, size_t size, size_t allocate_page_size)
 
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 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 DiscardSystemPages (void *address, size_t size) override
 

Detailed Description

Definition at line 26 of file bounded-page-allocator.h.

Member Function Documentation

◆ AllocatePages()

void * v8::base::BoundedPageAllocator::AllocatePages ( void *  address,
size_t  length,
size_t  alignment,
Permission  permissions 
)
overridevirtual

Allocates memory in range with the given alignment and permission.

Implements v8::PageAllocator.

Definition at line 28 of file bounded-page-allocator.cc.

◆ AllocatePageSize()

size_t v8::base::BoundedPageAllocator::AllocatePageSize ( )
inlineoverridevirtual

Gets the page granularity for AllocatePages and FreePages. Addresses and lengths for those calls should be multiples of AllocatePageSize().

Implements v8::PageAllocator.

Definition at line 44 of file bounded-page-allocator.h.

◆ CommitPageSize()

size_t v8::base::BoundedPageAllocator::CommitPageSize ( )
inlineoverridevirtual

Gets the page granularity for SetPermissions and ReleasePages. Addresses and lengths for those calls should be multiples of CommitPageSize().

Implements v8::PageAllocator.

Definition at line 46 of file bounded-page-allocator.h.

◆ 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.

Reimplemented from v8::PageAllocator.

Definition at line 114 of file bounded-page-allocator.cc.

◆ FreePages()

bool v8::base::BoundedPageAllocator::FreePages ( void *  address,
size_t  length 
)
overridevirtual

Frees memory in a range that was allocated by a call to AllocatePages.

Implements v8::PageAllocator.

Definition at line 62 of file bounded-page-allocator.cc.

◆ GetRandomMmapAddr()

void* v8::base::BoundedPageAllocator::GetRandomMmapAddr ( )
inlineoverridevirtual

Returns a randomized address, suitable for memory allocation under ASLR. The address will be aligned to AllocatePageSize.

Implements v8::PageAllocator.

Definition at line 52 of file bounded-page-allocator.h.

◆ ReleasePages()

bool v8::base::BoundedPageAllocator::ReleasePages ( void *  address,
size_t  length,
size_t  new_length 
)
overridevirtual

Releases memory in a range that was allocated by a call to AllocatePages.

Implements v8::PageAllocator.

Definition at line 73 of file bounded-page-allocator.cc.

◆ SetPermissions()

bool v8::base::BoundedPageAllocator::SetPermissions ( void *  address,
size_t  length,
Permission  permissions 
)
overridevirtual

Sets permissions on pages in an allocated range.

Implements v8::PageAllocator.

Definition at line 106 of file bounded-page-allocator.cc.

◆ SetRandomMmapSeed()

void v8::base::BoundedPageAllocator::SetRandomMmapSeed ( int64_t  seed)
inlineoverridevirtual

Sets the random seed so that GetRandomMmapAddr() will generate repeatable sequences of random mmap addresses.

Implements v8::PageAllocator.

Definition at line 48 of file bounded-page-allocator.h.


The documentation for this class was generated from the following files: