|
ESPHome 2025.12.0-dev
|
An STL allocator that uses SPI or internal RAM. More...
#include <helpers.h>
Public Types | |
| enum | Flags { NONE = 0 , ALLOC_EXTERNAL = 1 << 0 , ALLOC_INTERNAL = 1 << 1 , ALLOW_FAILURE = 1 << 2 } |
| using | value_type = T |
Public Member Functions | |
| RAMAllocator ()=default | |
| RAMAllocator (uint8_t flags) | |
| template<class U > | |
| constexpr | RAMAllocator (const RAMAllocator< U > &other) |
| T * | allocate (size_t n) |
| T * | allocate (size_t n, size_t manual_size) |
| T * | reallocate (T *p, size_t n) |
| T * | reallocate (T *p, size_t n, size_t manual_size) |
| void | deallocate (T *p, size_t n) |
| size_t | get_free_heap_size () const |
| Return the total heap space available via this allocator. | |
| size_t | get_max_free_block_size () const |
| Return the maximum size block this allocator could allocate. | |
An STL allocator that uses SPI or internal RAM.
Returns nullptr in case no memory is available.
By setting flags, it can be configured to:
| using esphome::RAMAllocator< T >::value_type = T |
| enum esphome::RAMAllocator::Flags |
|
default |
|
inline |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |