V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
v8::PageAllocator Class Referenceabstract

#include <v8-platform.h>

Inheritance diagram for v8::PageAllocator:
v8::base::BoundedPageAllocator

Public Types

enum  Permission {
  kNoAccess, kRead, kReadWrite, kReadWriteExecute,
  kReadExecute
}
 

Public Member Functions

virtual size_t AllocatePageSize ()=0
 
virtual size_t CommitPageSize ()=0
 
virtual void SetRandomMmapSeed (int64_t seed)=0
 
virtual void * GetRandomMmapAddr ()=0
 
virtual void * AllocatePages (void *address, size_t length, size_t alignment, Permission permissions)=0
 
virtual bool FreePages (void *address, size_t length)=0
 
virtual bool ReleasePages (void *address, size_t length, size_t new_length)=0
 
virtual bool SetPermissions (void *address, size_t length, Permission permissions)=0
 
virtual bool DiscardSystemPages (void *address, size_t size)
 

Detailed Description

A V8 memory page allocator.

Can be implemented by an embedder to manage large host OS allocations.

Definition at line 191 of file v8-platform.h.

Member Enumeration Documentation

◆ Permission

Memory permissions.

Definition at line 222 of file v8-platform.h.

Member Function Documentation

◆ AllocatePages()

virtual void* v8::PageAllocator::AllocatePages ( void *  address,
size_t  length,
size_t  alignment,
Permission  permissions 
)
pure virtual

Allocates memory in range with the given alignment and permission.

Implemented in v8::base::BoundedPageAllocator.

◆ AllocatePageSize()

virtual size_t v8::PageAllocator::AllocatePageSize ( )
pure virtual

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

Implemented in v8::base::BoundedPageAllocator.

◆ CommitPageSize()

virtual size_t v8::PageAllocator::CommitPageSize ( )
pure virtual

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

Implemented in v8::base::BoundedPageAllocator.

◆ DiscardSystemPages()

virtual bool v8::PageAllocator::DiscardSystemPages ( void *  address,
size_t  size 
)
inlinevirtual

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 in v8::base::BoundedPageAllocator.

Definition at line 259 of file v8-platform.h.

◆ FreePages()

virtual bool v8::PageAllocator::FreePages ( void *  address,
size_t  length 
)
pure virtual

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

Implemented in v8::base::BoundedPageAllocator.

◆ GetRandomMmapAddr()

virtual void* v8::PageAllocator::GetRandomMmapAddr ( )
pure virtual

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

Implemented in v8::base::BoundedPageAllocator.

◆ ReleasePages()

virtual bool v8::PageAllocator::ReleasePages ( void *  address,
size_t  length,
size_t  new_length 
)
pure virtual

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

Implemented in v8::base::BoundedPageAllocator.

◆ SetPermissions()

virtual bool v8::PageAllocator::SetPermissions ( void *  address,
size_t  length,
Permission  permissions 
)
pure virtual

Sets permissions on pages in an allocated range.

Implemented in v8::base::BoundedPageAllocator.

◆ SetRandomMmapSeed()

virtual void v8::PageAllocator::SetRandomMmapSeed ( int64_t  seed)
pure virtual

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

Implemented in v8::base::BoundedPageAllocator.


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