Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
v8::ExternalMemoryAccounter Class Reference

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

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.

Constructor & Destructor Documentation

◆ ExternalMemoryAccounter() [1/3]

v8::ExternalMemoryAccounter::ExternalMemoryAccounter ( )
default

◆ ~ExternalMemoryAccounter()

v8::ExternalMemoryAccounter::~ExternalMemoryAccounter ( )

◆ ExternalMemoryAccounter() [2/3]

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

◆ 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.

◆ GetTotalAmountOfExternalAllocatedMemoryForTesting()

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

Returns the amount of external memory registered for isolate.

◆ Increase()

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

Reports an increase of size bytes of external memory.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Update()

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

Reports an update of delta bytes of external memory.


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