Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
sktext::gpu::SubRunInitializer< T > Class Template Reference

#include <SubRunAllocator.h>

Public Member Functions

 SubRunInitializer (void *memory)
 
 ~SubRunInitializer ()
 
template<typename... Args>
Tinitialize (Args &&... args)
 

Detailed Description

template<typename T>
class sktext::gpu::SubRunInitializer< T >

Definition at line 186 of file SubRunAllocator.h.

Constructor & Destructor Documentation

◆ SubRunInitializer()

template<typename T >
sktext::gpu::SubRunInitializer< T >::SubRunInitializer ( void *  memory)
inline

Definition at line 188 of file SubRunAllocator.h.

188: fMemory{memory} { SkASSERT(memory != nullptr); }
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ ~SubRunInitializer()

template<typename T >
sktext::gpu::SubRunInitializer< T >::~SubRunInitializer ( )
inline

Definition at line 189 of file SubRunAllocator.h.

189 {
190 ::operator delete(fMemory);
191 }

Member Function Documentation

◆ initialize()

template<typename T >
template<typename... Args>
T * sktext::gpu::SubRunInitializer< T >::initialize ( Args &&...  args)
inline

Definition at line 193 of file SubRunAllocator.h.

193 {
194 // Warn on more than one initialization.
195 SkASSERT(fMemory != nullptr);
196 return new (std::exchange(fMemory, nullptr)) T(std::forward<Args>(args)...);
197 }
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
#define T
Definition: precompiler.cc:65

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