ecor
Loading...
Searching...
No Matches
ecor::task_memory_resource Struct Reference

Task memory resource that provides allocation and deallocation functions for tasks. More...

#include <ecor.hpp>

Public Member Functions

void * allocate (std::size_t const sz, std::size_t const align) const
 
void deallocate (void *p, std::size_t const sz, std::size_t const align) const
 
template<typename M >
 task_memory_resource (M &m) noexcept
 

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
 

Detailed Description

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.


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