|
Arduino DLNA Server
|
Custom allocator that uses ESP32's PSRAM for memory allocation. More...
#include <Allocator.h>
Classes | |
| struct | rebind |
| Rebind allocator to another type. More... | |
Public Types | |
| using | value_type = T |
| using | pointer = T * |
| using | const_pointer = const T * |
| using | reference = T & |
| using | const_reference = const T & |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
| using | is_always_equal = std::true_type |
| using | propagate_on_container_move_assignment = std::true_type |
Public Member Functions | |
| AllocatorPSRAM () noexcept | |
| Default constructor. | |
| template<typename U > | |
| AllocatorPSRAM (const AllocatorPSRAM< U > &) noexcept | |
| Copy constructor from another allocator type. | |
| pointer | allocate (size_type n) |
| Allocate memory from PSRAM. | |
| void | deallocate (pointer p, size_type) noexcept |
| Deallocate memory. | |
| template<typename U > | |
| bool | operator== (const AllocatorPSRAM< U > &) const noexcept |
| template<typename U > | |
| bool | operator!= (const AllocatorPSRAM< U > &) const noexcept |
Custom allocator that uses ESP32's PSRAM for memory allocation.
| T | Type of elements to allocate |
This allocator uses ESP32's heap_caps_malloc with MALLOC_CAP_SPIRAM flag to ensure all memory is allocated in PSRAM instead of regular RAM.
| using tiny_dlna::AllocatorPSRAM< T >::const_pointer = const T* |
| using tiny_dlna::AllocatorPSRAM< T >::const_reference = const T& |
| using tiny_dlna::AllocatorPSRAM< T >::difference_type = std::ptrdiff_t |
| using tiny_dlna::AllocatorPSRAM< T >::is_always_equal = std::true_type |
| using tiny_dlna::AllocatorPSRAM< T >::pointer = T* |
| using tiny_dlna::AllocatorPSRAM< T >::propagate_on_container_move_assignment = std::true_type |
| using tiny_dlna::AllocatorPSRAM< T >::reference = T& |
| using tiny_dlna::AllocatorPSRAM< T >::size_type = std::size_t |
| using tiny_dlna::AllocatorPSRAM< T >::value_type = T |
|
inlinenoexcept |
Default constructor.
|
inlinenoexcept |
Copy constructor from another allocator type.
| U | Type of the other allocator |
| other | The other allocator |
|
inline |
Allocate memory from PSRAM.
| n | Number of elements to allocate |
| std::bad_alloc | If allocation fails or size is too large |
|
inlinenoexcept |
Deallocate memory.
| p | Pointer to memory to deallocate |
| size | Size of allocation (unused) |
|
inlinenoexcept |
|
inlinenoexcept |