v8  8.6.395 (node 15.0.1)
V8 is Google's open source JavaScript engine
Heap Class Reference

#include <heap.h>

Data Structures

struct  HeapOptions
 
struct  ResourceConstraints
 

Public Types

enum class  StackSupport : uint8_t { kSupportsConservativeStackScan , kNoConservativeStackScan }
 
using StackState = EmbedderStackState
 

Public Member Functions

virtual ~Heap ()=default
 
void ForceGarbageCollectionSlow (const char *source, const char *reason, StackState stack_state=StackState::kMayContainHeapPointers)
 
AllocationHandle & GetAllocationHandle ()
 

Static Public Member Functions

static std::unique_ptr< HeapCreate (std::shared_ptr< Platform > platform, HeapOptions options=HeapOptions::Default())
 

Friends

class internal::Heap
 

Detailed Description

Definition at line 32 of file heap.h.

Member Typedef Documentation

◆ StackState

Specifies the stack state the embedder is in.

Definition at line 37 of file heap.h.

Member Enumeration Documentation

◆ StackSupport

enum StackSupport : uint8_t
strong

Specifies whether conservative stack scanning is supported.

Enumerator
kSupportsConservativeStackScan 

Conservative stack scan is supported.

kNoConservativeStackScan 

Conservative stack scan is not supported. Embedders may use this option when using custom infrastructure that is unsupported by the library.

Definition at line 42 of file heap.h.

Constructor & Destructor Documentation

◆ ~Heap()

virtual ~Heap ( )
virtualdefault

Member Function Documentation

◆ Create()

static std::unique_ptr<Heap> Create ( std::shared_ptr< Platform platform,
HeapOptions  options = HeapOptions::Default() 
)
static

Creates a new heap that can be used for object allocation.

Parameters
platformimplemented and provided by the embedder.
optionsHeapOptions specifying various properties for the Heap.
Returns
a new Heap instance.

◆ ForceGarbageCollectionSlow()

void ForceGarbageCollectionSlow ( const char *  source,
const char *  reason,
StackState  stack_state = StackState::kMayContainHeapPointers 
)

Forces garbage collection.

Parameters
sourceString specifying the source (or caller) triggering a forced garbage collection.
reasonString specifying the reason for the forced garbage collection.
stack_stateThe embedder stack state, see StackState.

◆ GetAllocationHandle()

AllocationHandle& GetAllocationHandle ( )

Friends And Related Function Documentation

◆ internal::Heap

friend class internal::Heap
friend

Definition at line 134 of file heap.h.


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