Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
cppgc Namespace Reference

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<typename T >
using Member = internal::BasicMember< T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy, internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage >
 
template<typename T >
using WeakMember = internal::BasicMember< T, internal::WeakMemberTag, internal::DijkstraWriteBarrierPolicy, internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage >
 
template<typename T >
using UntracedMember = internal::BasicMember< T, internal::UntracedMemberTag, internal::NoWriteBarrierPolicy, internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage >
 
template<typename T >
using Persistent = internal::BasicPersistent< T, internal::StrongPersistentPolicy >
 
template<typename T >
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 *)
 

Enumerations

enum class  EmbedderStackState { kMayContainHeapPointers , kNoHeapPointers }
 

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)
 
void InitializeProcess (PageAllocator *page_allocator=nullptr, size_t desired_heap_size=0)
 
void ShutdownProcess ()
 

Variables

constexpr internal::SentinelPointer kSentinelPointer
 
template<typename T >
constexpr bool IsGarbageCollectedMixinTypeV
 
template<typename T >
constexpr bool IsGarbageCollectedTypeV
 
template<typename T >
constexpr bool IsGarbageCollectedOrMixinTypeV
 
template<typename T >
constexpr bool IsGarbageCollectedWithMixinTypeV
 
template<typename T >
constexpr bool IsMemberTypeV = internal::IsMemberType<T>::value
 
template<typename T >
constexpr bool IsUntracedMemberTypeV = internal::IsUntracedMemberType<T>::value
 
template<typename T >
constexpr bool IsWeakMemberTypeV = internal::IsWeakMemberType<T>::value
 
template<typename T >
constexpr bool IsWeakV = internal::IsWeak<T>::value
 
template<typename T >
constexpr bool IsCompleteV = internal::IsComplete<T>::value
 
template<typename T >
constexpr bool IsMemberOrWeakMemberTypeV
 
template<typename T >
constexpr bool IsAnyMemberTypeV = internal::IsAnyMemberTypeV<std::decay_t<T>>
 

Detailed Description

cppgc - A C++ garbage collection library.

Typedef Documentation

◆ IdleTask

using cppgc::IdleTask = typedef v8::IdleTask

◆ JobDelegate

◆ JobHandle

◆ JobTask

using cppgc::JobTask = typedef v8::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

using cppgc::Task = typedef v8::Task

◆ TaskPriority

◆ TaskRunner

◆ TraceCallback

using cppgc::TraceCallback = typedef void (*)(Visitor* visitor, const void* object)

Callback for invoking tracing on a given object.

Parameters
visitorThe visitor to dispatch to.
objectThe object to invoke tracing on.

◆ TraceDescriptorCallback

using cppgc::TraceDescriptorCallback = typedef TraceDescriptor (*)(const void* address)

Callback for getting a TraceDescriptor for a given address.

Parameters
addressPossibly 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

using cppgc::WeakCallback = typedef void (*)(const LivenessBroker&, const void*)

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

Enumeration Type Documentation

◆ EmbedderStackState

enum class cppgc::EmbedderStackState
strong

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.

Function Documentation

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

Parameters
page_allocatorThe 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_sizeDesired 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.

◆ 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_bytesDenotes how many bytes to append to T.
argsList of arguments with which an instance of T will be constructed.
Returns
an instance of type T.
Here is the call graph for this function:

◆ 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
argsList of arguments with which an instance of T will be constructed.
Returns
an instance of type T.
Here is the call graph for this function:

◆ 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() call.

Variable Documentation

◆ IsAnyMemberTypeV

template<typename T >
constexpr bool cppgc::IsAnyMemberTypeV = internal::IsAnyMemberTypeV<std::decay_t<T>>
constexpr

Value is true for any member type.

◆ IsCompleteV

template<typename T >
constexpr bool cppgc::IsCompleteV = internal::IsComplete<T>::value
constexpr

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

◆ IsGarbageCollectedMixinTypeV

template<typename T >
constexpr bool cppgc::IsGarbageCollectedMixinTypeV
constexpr
Initial value:
=
internal::IsGarbageCollectedMixinType<T>::value

Value is true for types that inherit from GarbageCollectedMixin but not GarbageCollected<T> (i.e., they are free mixins), and false otherwise.

◆ IsGarbageCollectedOrMixinTypeV

template<typename T >
constexpr bool cppgc::IsGarbageCollectedOrMixinTypeV
constexpr
Initial value:
=
internal::IsGarbageCollectedOrMixinType<T>::value

Value is true for types that inherit from either GarbageCollected<T> or GarbageCollectedMixin, and false otherwise.

◆ IsGarbageCollectedTypeV

template<typename T >
constexpr bool cppgc::IsGarbageCollectedTypeV
constexpr
Initial value:
=
internal::IsGarbageCollectedType<T>::value

Value is true for types that inherit from GarbageCollected<T>, and false otherwise.

◆ IsGarbageCollectedWithMixinTypeV

template<typename T >
constexpr bool cppgc::IsGarbageCollectedWithMixinTypeV
constexpr
Initial value:
=
internal::IsGarbageCollectedWithMixinType<T>::value

Value is true for types that inherit from GarbageCollected<T> and GarbageCollectedMixin, and false otherwise.

◆ IsMemberOrWeakMemberTypeV

template<typename T >
constexpr bool cppgc::IsMemberOrWeakMemberTypeV
constexpr
Initial value:
=
IsMemberTypeV<T> || IsWeakMemberTypeV<T>

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

◆ IsMemberTypeV

template<typename T >
constexpr bool cppgc::IsMemberTypeV = internal::IsMemberType<T>::value
constexpr

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

◆ IsUntracedMemberTypeV

template<typename T >
constexpr bool cppgc::IsUntracedMemberTypeV = internal::IsUntracedMemberType<T>::value
constexpr

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

◆ IsWeakMemberTypeV

template<typename T >
constexpr bool cppgc::IsWeakMemberTypeV = internal::IsWeakMemberType<T>::value
constexpr

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

◆ IsWeakV

template<typename T >
constexpr bool cppgc::IsWeakV = internal::IsWeak<T>::value
constexpr

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

◆ kSentinelPointer

constexpr internal::SentinelPointer cppgc::kSentinelPointer
constexpr