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

#include <heap-consistency.h>

Collaboration diagram for cppgc::subtle::DisallowGarbageCollectionScope:

Public Member Functions

 DisallowGarbageCollectionScope (HeapHandle &heap_handle)
 
 ~DisallowGarbageCollectionScope ()
 
 DisallowGarbageCollectionScope (const DisallowGarbageCollectionScope &)=delete
 
DisallowGarbageCollectionScopeoperator= (const DisallowGarbageCollectionScope &)=delete
 

Static Public Member Functions

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

Private Member Functions

 CPPGC_STACK_ALLOCATED ()
 

Private Attributes

HeapHandleheap_handle_
 

Detailed Description

Disallows garbage collection finalizations. Any garbage collection triggers result in a crash when in this scope.

Note that the garbage collector already covers paths that can lead to garbage collections, so user code does not require checking IsGarbageCollectionAllowed() before allocations.

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

Constructor & Destructor Documentation

◆ DisallowGarbageCollectionScope() [1/2]

cppgc::subtle::DisallowGarbageCollectionScope::DisallowGarbageCollectionScope ( cppgc::HeapHandle & heap_handle)
explicit

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

Parameters
heap_handleThe corresponding heap.

Definition at line 33 of file heap-consistency.cc.

Here is the call graph for this function:

◆ ~DisallowGarbageCollectionScope()

cppgc::subtle::DisallowGarbageCollectionScope::~DisallowGarbageCollectionScope ( )

Definition at line 39 of file heap-consistency.cc.

Here is the call graph for this function:

◆ DisallowGarbageCollectionScope() [2/2]

cppgc::subtle::DisallowGarbageCollectionScope::DisallowGarbageCollectionScope ( const DisallowGarbageCollectionScope & )
delete

Member Function Documentation

◆ CPPGC_STACK_ALLOCATED()

cppgc::subtle::DisallowGarbageCollectionScope::CPPGC_STACK_ALLOCATED ( )
private

◆ Enter()

void cppgc::subtle::DisallowGarbageCollectionScope::Enter ( cppgc::HeapHandle & heap_handle)
static

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

Parameters
heap_handleThe corresponding heap.

Definition at line 22 of file heap-consistency.cc.

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

◆ IsGarbageCollectionAllowed()

bool cppgc::subtle::DisallowGarbageCollectionScope::IsGarbageCollectionAllowed ( cppgc::HeapHandle & heap_handle)
static
Returns
whether garbage collections are currently allowed.

Definition at line 15 of file heap-consistency.cc.

Here is the call graph for this function:

◆ Leave()

void cppgc::subtle::DisallowGarbageCollectionScope::Leave ( cppgc::HeapHandle & heap_handle)
static

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

Parameters
heap_handleThe corresponding heap.

Definition at line 28 of file heap-consistency.cc.

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

◆ operator=()

DisallowGarbageCollectionScope & cppgc::subtle::DisallowGarbageCollectionScope::operator= ( const DisallowGarbageCollectionScope & )
delete

Member Data Documentation

◆ heap_handle_

HeapHandle& cppgc::subtle::DisallowGarbageCollectionScope::heap_handle_
private

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


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