|
ecor
|
Task memory resource that provides allocation and deallocation functions for tasks. More...
#include <ecor.hpp>
Public Attributes | |
| void *(* | alloc )(void *, std::size_t const, std::size_t const) = nullptr |
| void(* | dealloc )(void *, void *, std::size_t const, std::size_t const) = nullptr |
| void * | mem = nullptr |
Task memory resource that provides allocation and deallocation functions for tasks.
This is used by the task implementation to allocate memory for the task state, and can be customized by the user to use different allocation strategies.
Type erasure is used to allow the task implementation to use the memory resource without knowing its type, and the memory resource is stored as a pointer to the user-provided allocator along with function pointers for allocation and deallocation that operate on the user-provided allocator.