v8  9.4.146 (node 16.13.0)
V8 is Google's open source JavaScript engine
NoGarbageCollectionScope Class Referencefinal

#include <heap-consistency.h>

Public Member Functions

 NoGarbageCollectionScope (HeapHandle &heap_handle)
 
 ~NoGarbageCollectionScope ()
 
 NoGarbageCollectionScope (const NoGarbageCollectionScope &)=delete
 
NoGarbageCollectionScopeoperator= (const NoGarbageCollectionScope &)=delete
 

Static Public Member Functions

static void Enter (HeapHandle &heap_handle)
 
static void Leave (HeapHandle &heap_handle)
 

Detailed Description

Avoids invoking garbage collection finalizations. Already running garbage collection phase are unaffected by this scope.

Should only be used temporarily as the scope has an impact on memory usage and follow up garbage collections.

Definition at line 197 of file heap-consistency.h.

Constructor & Destructor Documentation

◆ NoGarbageCollectionScope() [1/2]

NoGarbageCollectionScope ( HeapHandle &  heap_handle)
explicit

Constructs a scoped object that automatically enters and leaves a no garbage collection scope based on its lifetime.

Parameters
heap_handleThe corresponding heap.

◆ ~NoGarbageCollectionScope()

◆ NoGarbageCollectionScope() [2/2]

Member Function Documentation

◆ Enter()

static void Enter ( HeapHandle &  heap_handle)
static

Enters a no garbage collection scope. Must be paired with Leave(). Prefer a scope instance of NoGarbageCollectionScope.

Parameters
heap_handleThe corresponding heap.

◆ Leave()

static void Leave ( HeapHandle &  heap_handle)
static

Leaves a no garbage collection scope. Must be paired with Enter(). Prefer a scope instance of NoGarbageCollectionScope.

Parameters
heap_handleThe corresponding heap.

◆ operator=()

NoGarbageCollectionScope& operator= ( const NoGarbageCollectionScope )
delete

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