Module cppgc

Source

Structs§

Heap
A heap for allocating managed C++ objects.
HeapCreateParams
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.
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.
Ptr
Ptr is used to refer to an on-heap object from the stack.
Visitor
Visitor passed to trace methods. All managed pointers must have called the Visitor’s trace method on them.
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.

Enums§

EmbedderStackState
MarkingType
Specifies supported marking types.
SweepingType
Specifies supported sweeping types.

Traits§

GarbageCollected
Base trait for managed objects.

Functions§

initalize_processDeprecated
initialize_process
Process-global initialization of the garbage collector. Must be called before creating a Heap.
make_garbage_collected
Constructs an instance of T, which is a garbage collected type.
shutdown_process
Safety

Type Aliases§

InternalFieldIndex