v8  6.8.275 (node 10.15.3)
V8 is Google's open source JavaScript engine
PageAllocator Class Referenceabstract

#include <v8-platform.h>

Public Types

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

Public Member Functions

virtual ~PageAllocator ()=default
 
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
 

Detailed Description

A V8 memory page allocator.

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

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

Member Enumeration Documentation

◆ Permission

enum Permission

Memory permissions.

Enumerator
kNoAccess 
kRead 
kReadWrite 
kReadWriteExecute 
kReadExecute 

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

Constructor & Destructor Documentation

◆ ~PageAllocator()

virtual ~PageAllocator ( )
virtualdefault

Member Function Documentation

◆ AllocatePages()

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

Allocates memory in range with the given alignment and permission.

◆ AllocatePageSize()

virtual size_t AllocatePageSize ( )
pure virtual

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

◆ CommitPageSize()

virtual size_t CommitPageSize ( )
pure virtual

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

◆ FreePages()

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

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

◆ GetRandomMmapAddr()

virtual void* GetRandomMmapAddr ( )
pure virtual

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

◆ ReleasePages()

virtual bool 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.

◆ SetPermissions()

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

Sets permissions on pages in an allocated range.

◆ SetRandomMmapSeed()

virtual void SetRandomMmapSeed ( int64_t  seed)
pure virtual

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


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