|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
STL-compatible allocator for external PSRAM (SPI RAM). More...
Public Types | |
| using | value_type = T |
| The type of object to allocate. | |
Public Member Functions | |
| spiram_allocator ()=default | |
| Default constructor. | |
| template<typename U > | |
| constexpr | spiram_allocator (const spiram_allocator< U > &) noexcept |
| Rebinding copy constructor. | |
| T * | allocate (size_t n) |
| Allocates memory for n objects of type T from external PSRAM. | |
| void | deallocate (T *p, size_t) noexcept |
| Deallocates memory previously allocated by this allocator. | |
STL-compatible allocator for external PSRAM (SPI RAM).
This allocator uses the ESP-IDF heap_caps API to allocate memory from external PSRAM. It can be used with standard containers to place large data structures in PSRAM, freeing internal DRAM for performance-critical or DMA-capable allocations.
| T | The type of object to allocate. |
CONFIG_SPIRAM enabled. Definition at line 142 of file memory.hpp.
| using idfxx::spiram_allocator< T >::value_type = T |
The type of object to allocate.
Definition at line 143 of file memory.hpp.
|
default |
Default constructor.
|
inlineconstexprnoexcept |
Rebinding copy constructor.
| U | The source allocator's value type. |
Definition at line 154 of file memory.hpp.
|
inline |
Allocates memory for n objects of type T from external PSRAM.
| n | The number of objects to allocate space for. |
| std::bad_alloc | If allocation fails and exceptions are enabled. |
Definition at line 167 of file memory.hpp.
|
inlinenoexcept |
Deallocates memory previously allocated by this allocator.
| p | Pointer to the memory to deallocate. |
Definition at line 184 of file memory.hpp.