20#if defined(OS_USE_OS_APP_CONFIG_H)
21#include <cmsis-plus/os-app-config.h>
32#pragma clang diagnostic ignored "-Wc++98-compat"
53#pragma GCC diagnostic push
55#pragma clang diagnostic ignored "-Wexit-time-destructors"
56#pragma clang diagnostic ignored "-Wglobal-constructors"
62 static std::aligned_storage<
66 static std::aligned_storage<
70 static std::aligned_storage<
91#pragma GCC diagnostic push
93#pragma clang diagnostic ignored "-Wreserved-identifier"
97 static void __attribute__ ((constructor))
102#pragma GCC diagnostic pop
106#pragma GCC diagnostic pop
117#if !defined(OS_IS_CROSS_BUILD)
212 default_resource = res;
232 resource_thread = res;
250 resource_condition_variable = res;
268 resource_event_flags = res;
286 resource_memory_pool = res;
304 resource_message_queue = res;
322 resource_mutex = res;
340 resource_semaphore = res;
358 resource_timer = res;
422 return &other ==
this;
475 std::size_t bytes)
noexcept
479 allocated_bytes_ += bytes;
480 if (allocated_bytes_ > max_allocated_bytes_)
482 max_allocated_bytes_ = allocated_bytes_;
484 free_bytes_ -= bytes;
491 std::size_t bytes)
noexcept
495 allocated_bytes_ -= bytes;
496 free_bytes_ += bytes;
521 &rtos::memory::new_delete_res);
530#if !defined(OS_IS_CROSS_BUILD)
A memory manager that allocates memory via the system std::malloc() and deallocates via std::free().
A memory manager that allocates memory via the system operator new and deallocates via operator delet...
An internal memory manager that throws a bad_alloc() exception when trying to allocate.
Memory resource manager (abstract class).
virtual bool do_is_equal(memory_resource const &other) const noexcept
Implementation of the equality comparator.
virtual void do_reset(void) noexcept
Implementation of the function to reset the memory manager.
virtual bool do_coalesce(void) noexcept
Implementation of the function to coalesce free blocks.
void internal_increase_allocated_statistics(std::size_t bytes) noexcept
Update statistics after allocation.
void internal_decrease_allocated_statistics(std::size_t bytes) noexcept
Update statistics after deallocation.
virtual std::size_t do_max_size(void) const noexcept
Implementation of the function to get max size.
virtual ~memory_resource()
Destruct the memory resource object instance.
int printf(const char *format,...)
Write a formatted string to the trace device.
void init_once_default_resource(void)
memory_resource * set_default_resource(memory_resource *res) noexcept
Set the default RTOS system memory manager.
memory_resource * malloc_resource(void) noexcept
Get the address of a memory manager based on POSIX malloc().
memory_resource * set_resource_typed< condition_variable >(memory_resource *res) noexcept
memory_resource * set_resource_typed< message_queue >(memory_resource *res) noexcept
memory_resource * set_resource_typed< memory_pool >(memory_resource *res) noexcept
memory_resource * new_delete_resource(void) noexcept
Get the address of a memory manager based on new/delete.
memory_resource * set_resource_typed< event_flags >(memory_resource *res) noexcept
memory_resource * set_resource_typed< mutex >(memory_resource *res) noexcept
memory_resource * set_resource_typed< semaphore >(memory_resource *res) noexcept
memory_resource * set_resource_typed< thread >(memory_resource *res) noexcept
memory_resource * null_memory_resource(void) noexcept
Get the address of an ineffective memory manager.
memory_resource * set_resource_typed< timer >(memory_resource *res) noexcept
rtos::memory::memory_resource memory_resource
memory_resource * default_resource
Single file µOS++ RTOS definitions.