v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::ExternalMemoryAccounter Class Reference

#include <v8-external-memory-accounter.h>

Collaboration diagram for v8::ExternalMemoryAccounter:

Public Member Functions

 ExternalMemoryAccounter ()=default
 
 ~ExternalMemoryAccounter ()
 
 ExternalMemoryAccounter (ExternalMemoryAccounter &&)
 
ExternalMemoryAccounteroperator= (ExternalMemoryAccounter &&)
 
 ExternalMemoryAccounter (const ExternalMemoryAccounter &)=delete
 
ExternalMemoryAccounteroperator= (const ExternalMemoryAccounter &)=delete
 
void Increase (Isolate *isolate, size_t size)
 
void Update (Isolate *isolate, int64_t delta)
 
void Decrease (Isolate *isolate, size_t size)
 

Static Public Member Functions

static int64_t GetTotalAmountOfExternalAllocatedMemoryForTesting (const Isolate *isolate)
 

Detailed Description

This class is used to give V8 an indication of the amount of externally allocated memory that is kept alive by JavaScript objects. V8 uses this to decide when to perform garbage collections. Registering externally allocated memory will trigger garbage collections more often than it would otherwise in an attempt to garbage collect the JavaScript objects that keep the externally allocated memory alive. Instances of ExternalMemoryAccounter check that the reported external memory is back to 0 on destruction.

Definition at line 23 of file v8-external-memory-accounter.h.

Constructor & Destructor Documentation

◆ ExternalMemoryAccounter() [1/3]

v8::ExternalMemoryAccounter::ExternalMemoryAccounter ( )
default

◆ ~ExternalMemoryAccounter()

v8::ExternalMemoryAccounter::~ExternalMemoryAccounter ( )

Definition at line 12342 of file api.cc.

◆ ExternalMemoryAccounter() [2/3]

v8::ExternalMemoryAccounter::ExternalMemoryAccounter ( ExternalMemoryAccounter && other)

Definition at line 12348 of file api.cc.

◆ ExternalMemoryAccounter() [3/3]

v8::ExternalMemoryAccounter::ExternalMemoryAccounter ( const ExternalMemoryAccounter & )
delete

Member Function Documentation

◆ Decrease()

void v8::ExternalMemoryAccounter::Decrease ( Isolate * isolate,
size_t size )

Reports an decrease of size bytes of external memory.

Definition at line 12391 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTotalAmountOfExternalAllocatedMemoryForTesting()

int64_t v8::ExternalMemoryAccounter::GetTotalAmountOfExternalAllocatedMemoryForTesting ( const Isolate * isolate)
static

Returns the amount of external memory registered for isolate.

Definition at line 12406 of file api.cc.

Here is the call graph for this function:

◆ Increase()

void v8::ExternalMemoryAccounter::Increase ( Isolate * isolate,
size_t size )

Reports an increase of size bytes of external memory.

Definition at line 12371 of file api.cc.

Here is the caller graph for this function:

◆ operator=() [1/2]

ExternalMemoryAccounter & v8::ExternalMemoryAccounter::operator= ( const ExternalMemoryAccounter & )
delete

◆ operator=() [2/2]

ExternalMemoryAccounter & v8::ExternalMemoryAccounter::operator= ( ExternalMemoryAccounter && other)

Definition at line 12357 of file api.cc.

◆ Update()

void v8::ExternalMemoryAccounter::Update ( Isolate * isolate,
int64_t delta )

Reports an update of delta bytes of external memory.

Definition at line 12381 of file api.cc.


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