zpp
Zephyr C++20 Framework
|
Heap memory allocater CRTP base class. More...
#include <heap.hpp>
Public Types | |
using | native_type = struct k_heap |
using | native_pointer = native_type * |
using | native_const_pointer = native_type const * |
Public Member Functions | |
void * | allocate (size_t bytes) noexcept |
Allocate memory from this heap wainting forever. More... | |
void * | allocate (size_t bytes, size_t align) noexcept |
Allocate memory from this heap waiting forever. More... | |
void * | try_allocate (size_t bytes) noexcept |
Allocate memory from this heap without waiting. More... | |
void * | try_allocate (size_t bytes, size_t align) noexcept |
Allocate memory from this heap without waiting. More... | |
template<class T_Rep , class T_Period > | |
void * | try_allocate_for (size_t bytes, const std::chrono::duration< T_Rep, T_Period > &timeout) noexcept |
Allocate memory from this heap waiting with a timeout. More... | |
template<class T_Rep , class T_Period > | |
void * | try_allocate_for (size_t bytes, size_t align, const std::chrono::duration< T_Rep, T_Period > &timeout) noexcept |
Allocate memory from this heap waiting with a timeout. More... | |
void | deallocate (void *mem) noexcept |
Deallocate memory previously allocated. More... | |
auto | native_handle () noexcept -> native_pointer |
get the native zephyr heap handle. More... | |
auto | native_handle () const noexcept -> native_const_pointer |
get the native zephyr heap handle. More... | |
base_heap (const base_heap &)=delete | |
base_heap (base_heap &&)=delete | |
base_heap & | operator= (const base_heap &)=delete |
base_heap & | operator= (base_heap &&)=delete |
Protected Member Functions | |
constexpr | base_heap () noexcept |
default protected constructor so only derived objects can be created More... | |
Heap memory allocater CRTP base class.
using zpp::base_heap< T_Heap >::native_const_pointer = native_type const * |
using zpp::base_heap< T_Heap >::native_pointer = native_type* |
using zpp::base_heap< T_Heap >::native_type = struct k_heap |
|
inlineconstexprprotectednoexcept |
|
delete |
|
delete |
|
inlinenoexcept |
Allocate memory from this heap wainting forever.
bytes | the number of bytes to allocate |
Definition at line 42 of file heap.hpp.
References zpp::base_heap< T_Heap >::native_handle().
|
inlinenoexcept |
Allocate memory from this heap waiting forever.
bytes | the number of bytes to allocate |
align | the alignment of the allocated memory |
Definition at line 56 of file heap.hpp.
References zpp::base_heap< T_Heap >::native_handle().
|
inlinenoexcept |
Deallocate memory previously allocated.
mem | the memory to deallocate |
Definition at line 124 of file heap.hpp.
References zpp::base_heap< T_Heap >::native_handle().
|
inlinenoexcept |
get the native zephyr heap handle.
Definition at line 144 of file heap.hpp.
References zpp::base_heap< T_Heap >::native_handle().
|
inlinenoexcept |
get the native zephyr heap handle.
Definition at line 134 of file heap.hpp.
Referenced by zpp::base_heap< T_Heap >::allocate(), zpp::base_heap< T_Heap >::deallocate(), zpp::base_heap< T_Heap >::native_handle(), zpp::base_heap< T_Heap >::try_allocate(), and zpp::base_heap< T_Heap >::try_allocate_for().
|
delete |
|
delete |
|
inlinenoexcept |
Allocate memory from this heap without waiting.
bytes | the number of bytes to allocate |
Definition at line 69 of file heap.hpp.
References zpp::base_heap< T_Heap >::native_handle().
Referenced by zpp::thread::thread().
|
inlinenoexcept |
Allocate memory from this heap without waiting.
bytes | the number of bytes to allocate |
align | the alignment of the allocated memory |
Definition at line 83 of file heap.hpp.
References zpp::base_heap< T_Heap >::native_handle().
|
inlinenoexcept |
Allocate memory from this heap waiting with a timeout.
bytes | the number of bytes to allocate |
timeout | the time to try the allocation |
Definition at line 98 of file heap.hpp.
References zpp::base_heap< T_Heap >::native_handle(), and zpp::to_timeout().
|
inlinenoexcept |
Allocate memory from this heap waiting with a timeout.
bytes | the number of bytes to allocate |
align | the alignment of the allocated memory |
timeout | the time to try the allocation |
Definition at line 114 of file heap.hpp.
References zpp::base_heap< T_Heap >::native_handle(), and zpp::to_timeout().