Standard allocator based on the RTOS system default memory manager. More...
#include <cmsis-plus/rtos/os.h>
Public Types | |
using | value_type = T |
Type of elements to be allocated. | |
Public Member Functions | |
Constructors & Destructor | |
allocator_stateless_default_resource () noexcept=default | |
Default constructor. Construct a default resource allocator object instance. | |
allocator_stateless_default_resource (allocator_stateless_default_resource const &other)=default | |
Copy constructor. | |
template<typename U > | |
allocator_stateless_default_resource (allocator_stateless_default_resource< U > const &other) noexcept | |
Copy constructor template. | |
allocator_stateless_default_resource (allocator_stateless_default_resource &&other)=default | |
Move constructor. | |
~allocator_stateless_default_resource ()=default | |
Destruct the default resource allocator object instance. | |
Operators | |
allocator_stateless_default_resource & | operator= (allocator_stateless_default_resource const &other)=default |
Copy assignment operator. | |
allocator_stateless_default_resource & | operator= (allocator_stateless_default_resource &&other)=default |
Move assignment operator. | |
Public Member Functions | |
value_type * | allocate (std::size_t elements) |
Allocate a number of memory blocks of type value_type . | |
void | deallocate (value_type *addr, std::size_t elements) noexcept |
Deallocate the number of memory blocks of type value_type . | |
std::size_t | max_size (void) const noexcept |
The maximum number of elements that can be passed to allocate() . | |
Standard allocator based on the RTOS system default memory manager.
T | Type of elements to be allocated. |
This class template is used as the default allocator for system classes. It gets memory from the system default memory manager os::rtos::memory::get_default_resource()
.
Definition at line 539 of file os-memory.h.
using os::rtos::memory::allocator_stateless_default_resource< T >::value_type = T |
Type of elements to be allocated.
Definition at line 546 of file os-memory.h.
|
defaultnoexcept |
Default constructor. Construct a default resource allocator object instance.
|
default |
Copy constructor.
other | Reference to existing allocator. |
|
noexcept |
Copy constructor template.
other | Reference to allocator. |
|
default |
Move constructor.
other | Reference to existing allocator. |
|
default |
Destruct the default resource allocator object instance.
value_type * os::rtos::memory::allocator_stateless_default_resource< T >::allocate | ( | std::size_t | elements | ) |
Allocate a number of memory blocks of type value_type
.
elements | Number of elements of type value_type . |
|
noexcept |
Deallocate the number of memory blocks of type value_type
.
addr | Pointer to previously allocated memory blocks. |
elements | Number of elements of type value_type . |
|
noexcept |
The maximum number of elements that can be passed to allocate()
.
value_type
.
|
default |
Move assignment operator.
other | Reference to existing allocator. |
|
default |
Copy assignment operator.
other | Reference to existing allocator. |