v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
cppgc::MakeGarbageCollectedTraitBase< T > Class Template Reference

#include <allocation.h>

Inheritance diagram for cppgc::MakeGarbageCollectedTraitBase< T >:
Collaboration diagram for cppgc::MakeGarbageCollectedTraitBase< T >:

Static Protected Member Functions

static V8_INLINE void * Allocate (AllocationHandle &handle, size_t size)
 
static V8_INLINE void MarkObjectAsFullyConstructed (const void *payload)
 

Additional Inherited Members

- Static Private Member Functions inherited from cppgc::internal::MakeGarbageCollectedTraitInternal
static void MarkObjectAsFullyConstructed (const void *payload)
 

Detailed Description

template<typename T>
class cppgc::MakeGarbageCollectedTraitBase< T >

Base trait that provides utilities for advancers users that have custom allocation needs (e.g., overriding size). It's expected that users override MakeGarbageCollectedTrait (see below) and inherit from MakeGarbageCollectedTraitBase and make use of the low-level primitives offered to allocate and construct an object.

Definition at line 146 of file allocation.h.

Member Function Documentation

◆ Allocate()

template<typename T >
static V8_INLINE void * cppgc::MakeGarbageCollectedTraitBase< T >::Allocate ( AllocationHandle & handle,
size_t size )
inlinestaticprotected

Allocates memory for an object of type T.

Parameters
handleAllocationHandle identifying the heap to allocate the object on.
sizeThe size that should be reserved for the object.
Returns
the memory to construct an object of type T on.

Definition at line 165 of file allocation.h.

Here is the caller graph for this function:

◆ MarkObjectAsFullyConstructed()

template<typename T >
static V8_INLINE void cppgc::MakeGarbageCollectedTraitBase< T >::MarkObjectAsFullyConstructed ( const void * payload)
inlinestaticprotected

Marks an object as fully constructed, resulting in precise handling by the garbage collector.

Parameters
payloadThe base pointer the object is allocated at.

Definition at line 190 of file allocation.h.

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

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