13#ifndef CMSIS_PLUS_ISO_MEMORY_
14#define CMSIS_PLUS_ISO_MEMORY_
26#pragma GCC diagnostic push
28#pragma clang diagnostic ignored "-Wc++98-compat"
53 template<
typename T1,
typename T2>
58 template<
typename T1,
typename T2>
184 get_default_resource (
void)
noexcept
186 rtos::memory::init_once_default_resource ();
194 res_(get_default_resource())
210 res_(other.resource())
220 estd::__throw_system_error (
221 EINVAL,
"polymorphic_allocator<T>::allocate(std::size_t n)"
222 " 'n' exceeds maximum supported size");
233 assert(n <= max_size ());
241 return std::numeric_limits<std::size_t>::max () /
sizeof(
value_type);
261 template<
typename T,
typename U>
266 return *lhs.resource () == *rhs.resource ();
269 template<
typename T,
typename U>
274 return !(lhs == rhs);
282#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
bool operator==(thread::id x, thread::id y) noexcept
bool operator!=(thread::id x, thread::id y) noexcept