|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
STL-compatible allocator for capability-based memory regions. More...
Classes | |
| struct | rebind |
| Rebind the allocator to a different type. More... | |
Public Types | |
| using | value_type = T |
| The type of object to allocate. | |
Public Member Functions | |
| caps_allocator ()=default | |
| Default constructor. | |
| template<typename U > | |
| constexpr | caps_allocator (const caps_allocator< U, Caps, Alignment > &) noexcept |
| Rebinding copy constructor. | |
| T * | allocate (size_t n) |
| Allocates 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 capability-based memory regions.
Allocates memory from heap regions matching the specified capability flags. Can be used with standard containers to control memory placement.
When Alignment is non-zero, allocations are guaranteed to be aligned to the specified byte boundary. The alignment must be a power of two.
| T | The type of object to allocate. |
| Caps | The heap capability flags (e.g., memory_caps::dram). |
| Alignment | Allocation alignment in bytes (0 = default alignment, must be power of two when non-zero). |
Definition at line 252 of file memory.hpp.
The type of object to allocate.
Definition at line 253 of file memory.hpp.
|
default |
Default constructor.
|
inlineconstexprnoexcept |
Rebinding copy constructor.
| U | The source allocator's value type. |
Definition at line 274 of file memory.hpp.
Allocates memory for n objects of type T.
When Alignment is non-zero, the returned pointer is guaranteed to be aligned to Alignment bytes.
| n | The number of objects to allocate space for. |
| std::bad_alloc | If allocation fails and exceptions are enabled. |
Definition at line 290 of file memory.hpp.
References idfxx::to_underlying().
Deallocates memory previously allocated by this allocator.
| p | Pointer to the memory to deallocate. |
Definition at line 312 of file memory.hpp.