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

#include <testing.h>

Collaboration diagram for cppgc::testing::StandaloneTestingHeap:

Public Member Functions

 StandaloneTestingHeap (HeapHandle &)
 
void StartGarbageCollection ()
 
bool PerformMarkingStep (EmbedderStackState stack_state)
 
void FinalizeGarbageCollection (EmbedderStackState stack_state)
 
void ToggleMainThreadMarking (bool should_mark)
 
void ForceCompactionForNextGarbageCollection ()
 

Private Attributes

HeapHandleheap_handle_
 

Detailed Description

Testing interface for managed heaps that allows for controlling garbage collection timings. Embedders should use this class when testing the interaction of their code with incremental/concurrent garbage collection.

Definition at line 57 of file testing.h.

Constructor & Destructor Documentation

◆ StandaloneTestingHeap()

cppgc::testing::StandaloneTestingHeap::StandaloneTestingHeap ( HeapHandle & heap_handle)
explicit

Definition at line 23 of file testing.cc.

Member Function Documentation

◆ FinalizeGarbageCollection()

void cppgc::testing::StandaloneTestingHeap::FinalizeGarbageCollection ( EmbedderStackState stack_state)

Finalize the current garbage collection cycle atomically. Assumes that garbage collection is in progress.

Parameters
stack_stateThe state of the stack for finalizing the garbage collection cycle.

Definition at line 37 of file testing.cc.

Here is the call graph for this function:

◆ ForceCompactionForNextGarbageCollection()

void cppgc::testing::StandaloneTestingHeap::ForceCompactionForNextGarbageCollection ( )

Force enable compaction for the next garbage collection cycle.

Definition at line 49 of file testing.cc.

Here is the call graph for this function:

◆ PerformMarkingStep()

bool cppgc::testing::StandaloneTestingHeap::PerformMarkingStep ( EmbedderStackState stack_state)

Perform an incremental step. This will also schedule concurrent steps if needed.

Parameters
stack_stateThe state of the stack during the step.

Definition at line 31 of file testing.cc.

Here is the call graph for this function:

◆ StartGarbageCollection()

void cppgc::testing::StandaloneTestingHeap::StartGarbageCollection ( )

Start an incremental garbage collection.

Definition at line 26 of file testing.cc.

Here is the call graph for this function:

◆ ToggleMainThreadMarking()

void cppgc::testing::StandaloneTestingHeap::ToggleMainThreadMarking ( bool should_mark)

Toggle main thread marking on/off. Allows to stress concurrent marking (e.g. to better detect data races).

Parameters
should_markDenotes whether the main thread should contribute to marking. Defaults to true.

Definition at line 43 of file testing.cc.

Here is the call graph for this function:

Member Data Documentation

◆ heap_handle_

HeapHandle& cppgc::testing::StandaloneTestingHeap::heap_handle_
private

Definition at line 98 of file testing.h.


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