C/C++ API Reference
Loading...
Searching...
No Matches
Dynamic allocation

Overview

Heap allocate space for tasks.

Functions

template<typename Pendable >
Taskpw::async2::AllocateTask (pw::allocator::Allocator &allocator, Pendable &&pendable)
 
template<typename Pendable , typename... Args>
Taskpw::async2::AllocateTask (pw::allocator::Allocator &allocator, Args &&... args)
 

Function Documentation

◆ AllocateTask() [1/2]

template<typename Pendable , typename... Args>
Task * pw::async2::AllocateTask ( pw::allocator::Allocator allocator,
Args &&...  args 
)

Creates a Task by dynamically allocating Task memory from allocator.

Returns nullptr on allocation failure. Pendable must have a Poll<> Pend(Context&) method. allocator must outlive the resulting Task.

◆ AllocateTask() [2/2]

template<typename Pendable >
Task * pw::async2::AllocateTask ( pw::allocator::Allocator allocator,
Pendable &&  pendable 
)

Creates a Task by dynamically allocating Task memory from allocator.

Returns nullptr on allocation failure. Pendable must have a Poll<> Pend(Context&) method. allocator must outlive the resulting Task.