V8: cppgc Namespace Reference (original) (raw)

Namespaces
namespace internal
namespace subtle
namespace testing
Classes
struct AdditionalBytes
class CustomSpace
class CustomSpaceBase
struct CustomSpaceIndex
class DefaultPlatform
struct EphemeronPair
class GarbageCollected
class GarbageCollectedMixin
class Heap
class HeapHandle
struct HeapStatistics
class LivenessBroker
class MakeGarbageCollectedTrait
class MakeGarbageCollectedTraitBase
class NameProvider
class Platform
struct PostConstructionCallbackTrait
class ProcessHeapStatistics
struct SpaceTrait
struct TraceDescriptor
struct TraceTrait
struct TraceTrait< v8::TracedReference< T > >
class Visitor
Typedefs
template
using Member = internal::BasicMember< T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy, internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage >
template
using WeakMember = internal::BasicMember< T, internal::WeakMemberTag, internal::DijkstraWriteBarrierPolicy, internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage >
template
using UntracedMember = internal::BasicMember< T, internal::UntracedMemberTag, internal::NoWriteBarrierPolicy, internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage >
template
using Persistent = internal::BasicPersistent< T, internal::StrongPersistentPolicy >
template
using WeakPersistent = internal::BasicPersistent< T, internal::WeakPersistentPolicy >
using IdleTask = v8::IdleTask
using JobHandle = v8::JobHandle
using JobDelegate = v8::JobDelegate
using JobTask = v8::JobTask
using PageAllocator = v8::PageAllocator
using Task = v8::Task
using TaskPriority = v8::TaskPriority
using TaskRunner = v8::TaskRunner
using TracingController = v8::TracingController
using SourceLocation = v8::SourceLocation
using TraceCallback = void(*)(Visitor *visitor, const void *object)
using TraceDescriptorCallback = TraceDescriptor(*)(const void *address)
using WeakCallback = void(*)(const LivenessBroker &, const void *)
Functions
template<typename T , typename... Args>
T * MakeGarbageCollected (AllocationHandle &handle, Args &&... args)
template<typename T , typename... Args>
T * MakeGarbageCollected (AllocationHandle &handle, AdditionalBytes additional_bytes, Args &&... args)
bool IsInitialized ()
void InitializeProcess (PageAllocator *page_allocator=nullptr, size_t desired_heap_size=0)
void ShutdownProcess ()
Variables
constexpr internal::SentinelPointer kSentinelPointer
template
constexpr bool IsGarbageCollectedMixinTypeV
template
constexpr bool IsGarbageCollectedTypeV
template
constexpr bool IsGarbageCollectedOrMixinTypeV
template
constexpr bool IsGarbageCollectedWithMixinTypeV
template
constexpr bool IsMemberTypeV = internal::IsMemberType::value
template
constexpr bool IsUntracedMemberTypeV = internal::IsUntracedMemberType::value
template
constexpr bool IsWeakMemberTypeV = internal::IsWeakMemberType::value
template
constexpr bool IsWeakV = internal::IsWeak::value
template
constexpr bool IsCompleteV = internal::IsComplete::value
template
constexpr bool IsMemberOrWeakMemberTypeV
template
constexpr bool IsAnyMemberTypeV = internal::IsAnyMemberTypeV<std::decay_t>

cppgc - A C++ garbage collection library.

IdleTask

JobDelegate

JobHandle

JobTask

Member

Members are used in classes to contain strong pointers to other garbage collected objects. All Member fields of a class must be traced in the class' trace method.

PageAllocator

Persistent

Persistent is a way to create a strong pointer from an off-heap object to another on-heap object. As long as the Persistent handle is alive the GC will keep the object pointed to alive. The Persistent handle is always a GC root from the point of view of the GC. Persistent must be constructed and destructed in the same thread.

SourceLocation

Task

TaskPriority

TaskRunner

TraceCallback

Callback for invoking tracing on a given object.

Parameters

visitor The visitor to dispatch to.
object The object to invoke tracing on.

TraceDescriptorCallback

Callback for getting a TraceDescriptor for a given address.

Parameters

address Possibly inner address of an object.

Returns

a TraceDescriptor for the provided address.

TracingController

UntracedMember

UntracedMember is a pointer to an on-heap object that is not traced for some reason. Do not use this unless you know what you are doing. Keeping raw pointers to on-heap objects is prohibited unless used from stack. Pointee must be kept alive through other means.

WeakCallback

WeakMember

WeakMember is similar to Member in that it is used to point to other garbage collected objects. However instead of creating a strong pointer to the object, the WeakMember creates a weak pointer, which does not keep the pointee alive. Hence if all pointers to to a heap allocated object are weak the object will be garbage collected. At the time of GC the weak pointers will automatically be set to null.

WeakPersistent

WeakPersistent is a way to create a weak pointer from an off-heap object to an on-heap object. The pointer is automatically cleared when the pointee gets collected. WeakPersistent must be constructed and destructed in the same thread.

EmbedderStackState

Indicator for the stack state of the embedder.

Enumerator
kMayContainHeapPointers Stack may contain interesting heap pointers.
kNoHeapPointers Stack does not contain any interesting heap pointers.

InitializeProcess()

void cppgc::InitializeProcess ( PageAllocator * page_allocator = nullptr,
size_t desired_heap_size = 0
)

Process-global initialization of the garbage collector. Must be called before creating a Heap.

Can be called multiple times when paired with [ShutdownProcess()](namespacecppgc.html#a3cb7b63d49a5b48410aa5c9757eca39f).

Parameters

page_allocator The allocator used for maintaining meta data. Must stay always alive and not change between multiple calls to InitializeProcess. If no allocator is provided, a default internal version will be used.
desired_heap_size Desired amount of virtual address space to reserve for the heap, in bytes. Actual size will be clamped to minimum and maximum values based on compile-time settings and may be rounded up. If this parameter is zero, a default value will be used.

IsInitialized()

bool cppgc::IsInitialized ( )

MakeGarbageCollected() [1/2]

template<typename T , typename... Args>

T * cppgc::MakeGarbageCollected ( AllocationHandle & handle, AdditionalBytes additional_bytes, Args &&... args ) inline

Constructs a managed object of type T where T transitively inherits from GarbageCollected. Created objects will have additional bytes appended to it. Allocated memory would suffice for sizeof(T) + additional_bytes.

Parameters

additional_bytes Denotes how many bytes to append to T.
args List of arguments with which an instance of T will be constructed.

Returns

an instance of type T.

MakeGarbageCollected() [2/2]

template<typename T , typename... Args>

T * cppgc::MakeGarbageCollected ( AllocationHandle & handle, Args &&... args ) inline

Constructs a managed object of type T where T transitively inherits from GarbageCollected.

Parameters

args List of arguments with which an instance of T will be constructed.

Returns

an instance of type T.

ShutdownProcess()

void cppgc::ShutdownProcess ( )

Must be called after destroying the last used heap. Some process-global metadata may not be returned and reused upon a subsequent [InitializeProcess()](namespacecppgc.html#a7dc95658081246e6b9d4279d6a94bee6) call.

IsAnyMemberTypeV

template

constexpr bool cppgc::IsAnyMemberTypeV = internal::IsAnyMemberTypeV<std::decay_t> constexpr

Value is true for any member type.

IsCompleteV

Value is true for types that are complete, and false otherwise.

IsGarbageCollectedMixinTypeV

template

constexpr bool cppgc::IsGarbageCollectedMixinTypeV constexpr

Initial value:

=

internal::IsGarbageCollectedMixinType::value

Value is true for types that inherit from [GarbageCollectedMixin](classcppgc%5F1%5F1GarbageCollectedMixin.html) but not [GarbageCollected](classcppgc%5F1%5F1GarbageCollected.html)<T> (i.e., they are free mixins), and false otherwise.

IsGarbageCollectedOrMixinTypeV

template

constexpr bool cppgc::IsGarbageCollectedOrMixinTypeV constexpr

IsGarbageCollectedTypeV

template

constexpr bool cppgc::IsGarbageCollectedTypeV constexpr

Initial value:

=

internal::IsGarbageCollectedType::value

Value is true for types that inherit from [GarbageCollected](classcppgc%5F1%5F1GarbageCollected.html)<T>, and false otherwise.

IsGarbageCollectedWithMixinTypeV

template

constexpr bool cppgc::IsGarbageCollectedWithMixinTypeV constexpr

IsMemberOrWeakMemberTypeV

template

constexpr bool cppgc::IsMemberOrWeakMemberTypeV constexpr

Initial value:

=

IsMemberTypeV || IsWeakMemberTypeV

Value is true for member types Member<T> and WeakMember<T>.

IsMemberTypeV

Value is true for types of type Member<T>, and false otherwise.

IsUntracedMemberTypeV

Value is true for types of type UntracedMember<T>, and false otherwise.

IsWeakMemberTypeV

Value is true for types of type WeakMember<T>, and false otherwise.

IsWeakV

Value is true for types that are considered weak references, and false otherwise.

kSentinelPointer