16#include "pw_allocator/allocator.h"
17#include "pw_async2/dispatcher.h"
18#include "pw_async2/owned_task.h"
23template <
typename Pendable>
26 template <
typename... Args>
27 AllocatedTask(pw::allocator::Deallocator& deallocator, Args&&... args)
28 : deallocator_(deallocator), pendable_(std::forward<Args>(args)...) {}
33 void DoDestroy()
override { deallocator_.Delete(
this); }
35 pw::allocator::Deallocator& deallocator_;
49template <
typename Pendable>
52 allocator, std::forward<Pendable>(pendable));
61template <
typename Pendable,
typename... Args>
64 allocator, std::forward<Args>(args)...);
Definition: allocator.h:36
std::enable_if_t<!std::is_array_v< T >, T * > New(Args &&... args)
Definition: allocator.h:57
Definition: owned_task.h:31
Definition: allocate_task.h:24
Poll DoPend(Context &cx) override
Definition: allocate_task.h:31
void DoDestroy() override
Definition: allocate_task.h:33
Task * AllocateTask(pw::allocator::Allocator &allocator, Pendable &&pendable)
Definition: allocate_task.h:50