ESPHome
2025.2.0
|
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) |
void | deallocate (T *p, size_t n) |
size_t | get_free_heap_size () const |
Return the total heap space available via this allocator. More... | |
size_t | get_max_free_block_size () const |
Return the maximum size block this allocator could allocate. More... | |
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 |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |