|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
STL-compatible allocator for DMA-capable memory. More...
Public Types | |
| using | value_type = T |
| The type of object to allocate. | |
Public Member Functions | |
| dma_allocator ()=default | |
| Default constructor. | |
| template<typename U > | |
| constexpr | dma_allocator (const dma_allocator< U > &) noexcept |
| Rebinding copy constructor. | |
| T * | allocate (size_t n) |
| Allocates DMA-capable memory for n objects of type T. | |
| void | deallocate (T *p, size_t) noexcept |
| Deallocates memory previously allocated by this allocator. | |
STL-compatible allocator for DMA-capable memory.
This allocator uses the ESP-IDF heap_caps API to allocate memory that is suitable for DMA transfers. It can be used with standard containers to create buffers for SPI, I2S, LCD, and other DMA-capable peripherals.
| T | The type of object to allocate. |
Definition at line 222 of file memory.hpp.
| using idfxx::dma_allocator< T >::value_type = T |
The type of object to allocate.
Definition at line 223 of file memory.hpp.
|
default |
Default constructor.
|
inlineconstexprnoexcept |
Rebinding copy constructor.
| U | The source allocator's value type. |
Definition at line 234 of file memory.hpp.
|
inline |
Allocates DMA-capable memory for n objects of type T.
| n | The number of objects to allocate space for. |
| std::bad_alloc | If allocation fails and exceptions are enabled. |
Definition at line 247 of file memory.hpp.
|
inlinenoexcept |
Deallocates memory previously allocated by this allocator.
| p | Pointer to the memory to deallocate. |
Definition at line 264 of file memory.hpp.