28#ifndef CMSIS_PLUS_ISO_MEMORY_
29#define CMSIS_PLUS_ISO_MEMORY_
41#pragma GCC diagnostic push
44#pragma clang diagnostic ignored "-Wc++98-compat"
68 template<
typename T1,
typename T2>
73 template<
typename T1,
typename T2>
199 get_default_resource (
void)
noexcept
201 rtos::memory::init_once_default_resource ();
209 res_(get_default_resource())
227 res_(other.resource())
238 estd::__throw_system_error (
239 EINVAL,
"polymorphic_allocator<T>::allocate(std::size_t n)"
240 " 'n' exceeds maximum supported size");
251 assert(n <= max_size ());
259 return std::numeric_limits<std::size_t>::max () /
sizeof(
value_type);
279 template<
typename T,
typename U>
284 return *lhs.resource () == *rhs.resource ();
287 template<
typename T,
typename U>
292 return !(lhs == rhs);
300#pragma GCC diagnostic pop
polymorphic_allocator() noexcept
memory_resource * resource(void) const noexcept
std::size_t max_size(void) const noexcept
void deallocate(value_type *p, std::size_t n) noexcept
polymorphic_allocator select_on_container_copy_construction(void) const noexcept
value_type * allocate(std::size_t n)
Memory resource manager (abstract class).
void deallocate(void *addr, std::size_t bytes, std::size_t alignment=max_align) noexcept
Deallocate the previously allocated memory block.
void * allocate(std::size_t bytes, std::size_t alignment=max_align)
Allocate a memory block.
memory_resource * new_delete_resource(void) noexcept
Get the address of a memory manager based on new/delete.
memory_resource * get_default_resource(void) noexcept
Get the default application memory manager.
memory_resource * set_default_resource(memory_resource *res) noexcept
Set the default application memory manager.
memory_resource * null_memory_resource(void) noexcept
Get the address of an ineffective memory manager.
memory_resource * default_resource
bool operator==(const polymorphic_allocator< T1 > &a, const polymorphic_allocator< T2 > &b) noexcept
bool operator!=(const polymorphic_allocator< T1 > &a, const polymorphic_allocator< T2 > &b) noexcept
void __throw_bad_alloc(void)
bool operator==(thread::id x, thread::id y) noexcept
bool operator!=(thread::id x, thread::id y) noexcept