Heap allocate space for tasks or functions with pw::Allocator
Functions | |
| template<typename Pendable > | |
| Task * | pw::async2::AllocateTask (pw::allocator::Allocator &allocator, Pendable &&pendable) |
| template<typename Pendable , typename... Args> | |
| Task * | pw::async2::AllocateTask (pw::allocator::Allocator &allocator, Args &&... args) |
| template<typename Func > | |
| void | pw::async2::EnqueueHeapFunc (Dispatcher &dispatcher, Func &&func) |
| Task * pw::async2::AllocateTask | ( | pw::allocator::Allocator & | allocator, |
| Args &&... | args | ||
| ) |
| Task * pw::async2::AllocateTask | ( | pw::allocator::Allocator & | allocator, |
| Pendable && | pendable | ||
| ) |
| void pw::async2::EnqueueHeapFunc | ( | Dispatcher & | dispatcher, |
| Func && | func | ||
| ) |
Heap-allocates space for func and enqueues it to run on dispatcher.
func must be a no-argument callable that returns void.
This function requires heap allocation using new be available.