µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.
os-memory.h File Reference
#include <cmsis-plus/estd/system_error>
#include <limits>
#include <new>
#include <cerrno>
#include <mutex>

Go to the source code of this file.

Classes

class  os::rtos::memory::allocator_deleter< A >
 Allocator deleter. More...
 
class  os::rtos::memory::allocator_stateless_default_resource< T >
 Standard allocator based on the RTOS system default memory manager. More...
 
class  os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >
 Allocator using memory resources. More...
 
class  os::estd::lock_guard< L >
 
class  os::rtos::memory::memory_resource
 Memory resource manager (abstract class). More...
 
struct  os::rtos::memory::allocator_stateless_polymorphic_synchronized< T, L, get_resource >::rebind< U >
 Define a rebind template. More...
 

Namespaces

 os
 System namespace.
 
 os::estd
 Embedded std namespace.
 
 os::rtos
 RTOS namespace.
 
 os::rtos::memory
 
 os::rtos::scheduler
 Scheduler namespace.
 

Types

template<typename T , typename U = T>
using os::rtos::memory::allocator_typed = allocator_stateless_polymorphic_synchronized< T, scheduler::lockable, get_resource_typed< U > >
 Type of an allocator for objects of type T. More...
 
using os::rtos::memory::out_of_memory_handler_t = void(*)(void)
 Type of out of memory handler. More...
 
template<typename T , typename U = T>
using os::rtos::memory::unique_ptr = std::unique_ptr< T, allocator_deleter< allocator_typed< T, U > >>
 Type of a RTOS unique pointer to objects of type T. More...
 

Functions

void os::estd::__throw_bad_alloc (void)
 
constexpr std::size_t os::rtos::memory::align_size (std::size_t size, std::size_t align) noexcept
 Helper function to align size values. More...
 
template<typename T , typename A , typename ... Args>
auto os::rtos::memory::allocate_unique (const A &allocator, Args &&... args)
 Function template to allocate a unique pointer. More...
 
constexpr std::size_t os::rtos::memory::max (std::size_t a, std::size_t b)
 
template<typename T1 , typename T2 , typename L , F get_resource>
bool os::rtos::memory::operator!= (const allocator_stateless_polymorphic_synchronized< T1, L, get_resource > &lhs, const allocator_stateless_polymorphic_synchronized< T2, L, get_resource > &rhs) noexcept
 
template<typename T , typename U , typename L , F get_resource>
bool os::rtos::memory::operator!= (allocator_stateless_polymorphic_synchronized< T, L, get_resource > const &lhs, allocator_stateless_polymorphic_synchronized< U, L, get_resource > const &rhs) noexcept
 
template<typename T1 , typename T2 , typename L , F get_resource>
bool os::rtos::memory::operator== (const allocator_stateless_polymorphic_synchronized< T1, L, get_resource > &lhs, const allocator_stateless_polymorphic_synchronized< T2, L, get_resource > &rhs) noexcept
 
template<typename T , typename U , typename L , F get_resource>
bool os::rtos::memory::operator== (allocator_stateless_polymorphic_synchronized< T, L, get_resource > const &lhs, allocator_stateless_polymorphic_synchronized< U, L, get_resource > const &rhs) noexcept
 
RTOS System Memory Functions
memory_resource * os::rtos::memory::malloc_resource (void) noexcept
 Get the address of a memory manager based on POSIX malloc(). More...
 
memory_resource * os::rtos::memory::set_default_resource (memory_resource *res) noexcept
 Set the default RTOS system memory manager. More...
 
memory_resource * os::rtos::memory::get_default_resource (void) noexcept
 Get the default RTOS system memory manager. More...
 
void os::rtos::memory::init_once_default_resource (void)
 
Operators
bool os::rtos::memory::operator== (const memory_resource &lhs, const memory_resource &rhs) noexcept
 Compare the memory_resource instances for equality. More...
 
bool os::rtos::memory::operator!= (const memory_resource &lhs, const memory_resource &rhs) noexcept
 Compare the memory_resource instances for inequality. More...
 
Type Specific Resource Managers
template<typename T >
memory_resource * os::rtos::memory::set_resource_typed (memory_resource *res) noexcept
 Function template to set a memory resource. More...
 
template<typename T >
memory_resource * os::rtos::memory::get_resource_typed (void) noexcept
 Function template to get a memory resource. More...
 
template<>
memory_resource * os::rtos::memory::set_resource_typed< thread > (memory_resource *res) noexcept
 
template<>
memory_resource * os::rtos::memory::get_resource_typed< thread > (void) noexcept
 
template<>
memory_resource * os::rtos::memory::set_resource_typed< condition_variable > (memory_resource *res) noexcept
 
template<>
memory_resource * os::rtos::memory::get_resource_typed< condition_variable > (void) noexcept
 
template<>
memory_resource * os::rtos::memory::set_resource_typed< event_flags > (memory_resource *res) noexcept
 
template<>
memory_resource * os::rtos::memory::get_resource_typed< event_flags > (void) noexcept
 
template<>
memory_resource * os::rtos::memory::set_resource_typed< memory_pool > (memory_resource *res) noexcept
 
template<>
memory_resource * os::rtos::memory::get_resource_typed< memory_pool > (void) noexcept
 
template<>
memory_resource * os::rtos::memory::set_resource_typed< message_queue > (memory_resource *res) noexcept
 
template<>
memory_resource * os::rtos::memory::get_resource_typed< message_queue > (void) noexcept
 
template<>
memory_resource * os::rtos::memory::set_resource_typed< mutex > (memory_resource *res) noexcept
 
template<>
memory_resource * os::rtos::memory::get_resource_typed< mutex > (void) noexcept
 
template<>
memory_resource * os::rtos::memory::set_resource_typed< semaphore > (memory_resource *res) noexcept
 
template<>
memory_resource * os::rtos::memory::get_resource_typed< semaphore > (void) noexcept
 
template<>
memory_resource * os::rtos::memory::set_resource_typed< timer > (memory_resource *res) noexcept
 
template<>
memory_resource * os::rtos::memory::get_resource_typed< timer > (void) noexcept