v8  8.4.371(node14.15.0)
V8 is Google's open source JavaScript engine
MeasureMemoryDelegate Class Referenceabstract

#include <v8.h>

Public Member Functions

virtual ~MeasureMemoryDelegate ()=default
 
virtual bool ShouldMeasure (Local< Context > context)=0
 
virtual void MeasurementComplete (const std::vector< std::pair< Local< Context >, size_t >> &context_sizes_in_bytes, size_t unattributed_size_in_bytes)=0
 

Static Public Member Functions

static std::unique_ptr< MeasureMemoryDelegateDefault (Isolate *isolate, Local< Context > context, Local< Promise::Resolver > promise_resolver, MeasureMemoryMode mode)
 

Detailed Description

The delegate is used in Isolate::MeasureMemory API.

It specifies the contexts that need to be measured and gets called when the measurement is completed to report the results.

Definition at line 8082 of file v8.h.

Constructor & Destructor Documentation

◆ ~MeasureMemoryDelegate()

virtual ~MeasureMemoryDelegate ( )
virtualdefault

Member Function Documentation

◆ Default()

static std::unique_ptr<MeasureMemoryDelegate> Default ( Isolate isolate,
Local< Context context,
Local< Promise::Resolver promise_resolver,
MeasureMemoryMode  mode 
)
static

Returns a default delegate that resolves the given promise when the memory measurement completes.

Parameters
isolatethe current isolate
contextthe current context
promise_resolverthe promise resolver that is given the result of the memory measurement.
modethe detail level of the result.

◆ MeasurementComplete()

virtual void MeasurementComplete ( const std::vector< std::pair< Local< Context >, size_t >> &  context_sizes_in_bytes,
size_t  unattributed_size_in_bytes 
)
pure virtual

This function is called when memory measurement finishes.

Parameters
context_sizes_in_bytesa vector of (context, size) pairs that includes each context for which ShouldMeasure returned true and that was not garbage collected while the memory measurement was in progress.
unattributed_size_in_bytestotal size of objects that were not attributed to any context (i.e. are likely shared objects).

◆ ShouldMeasure()

virtual bool ShouldMeasure ( Local< Context context)
pure virtual

Returns true if the size of the given context needs to be measured.


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