idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
Memory Allocators

STL-compatible allocators for ESP-IDF memory regions. More...

Namespaces

namespace  idfxx
 

Classes

struct  idfxx::dram_allocator< T >
 STL-compatible allocator for internal DRAM. More...
 
struct  idfxx::spiram_allocator< T >
 STL-compatible allocator for external PSRAM (SPI RAM). More...
 
struct  idfxx::dma_allocator< T >
 STL-compatible allocator for DMA-capable memory. More...
 

Enumerations

enum class  idfxx::memory_type : uint32_t {
  idfxx::memory_type::internal = MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT ,
  idfxx::memory_type::spiram = MALLOC_CAP_SPIRAM
}
 Memory region type for heap allocations. More...
 

Functions

template<typename T , typename U >
bool idfxx::operator== (const dram_allocator< T > &, const dram_allocator< U > &)
 Equality comparison for dram_allocator.
 
template<typename T , typename U >
bool idfxx::operator!= (const dram_allocator< T > &, const dram_allocator< U > &)
 Inequality comparison for dram_allocator.
 
template<typename T , typename U >
bool idfxx::operator== (const spiram_allocator< T > &, const spiram_allocator< U > &)
 Equality comparison for spiram_allocator.
 
template<typename T , typename U >
bool idfxx::operator!= (const spiram_allocator< T > &, const spiram_allocator< U > &)
 Inequality comparison for spiram_allocator.
 
template<typename T , typename U >
bool idfxx::operator== (const dma_allocator< T > &, const dma_allocator< U > &)
 Equality comparison for dma_allocator.
 
template<typename T , typename U >
bool idfxx::operator!= (const dma_allocator< T > &, const dma_allocator< U > &)
 Inequality comparison for dma_allocator.
 

Detailed Description

STL-compatible allocators for ESP-IDF memory regions.

Provides allocators for internal DRAM, external PSRAM, and DMA-capable memory that can be used with standard containers.

Enumeration Type Documentation

◆ memory_type

enum class idfxx::memory_type : uint32_t
strong

Memory region type for heap allocations.

Controls where memory is allocated. Use internal for default internal DRAM allocation, or spiram to allocate from external PSRAM (freeing internal memory for DMA buffers and performance-critical data).

Used by components such as Task Component (for stack allocation) and Queue Component (for queue storage) to control memory placement.

Note
spiram requires a device with external PSRAM and CONFIG_SPIRAM enabled.
Enumerator
internal 

Internal DRAM (default)

spiram 

External PSRAM.

Definition at line 42 of file memory.hpp.

Function Documentation

◆ operator!=() [1/3]

template<typename T , typename U >
bool idfxx::operator!= ( const dma_allocator< T > &  ,
const dma_allocator< U > &   
)

Inequality comparison for dma_allocator.

All dma_allocator instances are considered equal.

Returns
Always returns false.

Definition at line 287 of file memory.hpp.

◆ operator!=() [2/3]

template<typename T , typename U >
bool idfxx::operator!= ( const dram_allocator< T > &  ,
const dram_allocator< U > &   
)

Inequality comparison for dram_allocator.

All dram_allocator instances are considered equal.

Returns
Always returns false.

Definition at line 124 of file memory.hpp.

◆ operator!=() [3/3]

template<typename T , typename U >
bool idfxx::operator!= ( const spiram_allocator< T > &  ,
const spiram_allocator< U > &   
)

Inequality comparison for spiram_allocator.

All spiram_allocator instances are considered equal.

Returns
Always returns false.

Definition at line 207 of file memory.hpp.

◆ operator==() [1/3]

template<typename T , typename U >
bool idfxx::operator== ( const dma_allocator< T > &  ,
const dma_allocator< U > &   
)

Equality comparison for dma_allocator.

All dma_allocator instances are considered equal.

Returns
Always returns true.

Definition at line 275 of file memory.hpp.

◆ operator==() [2/3]

template<typename T , typename U >
bool idfxx::operator== ( const dram_allocator< T > &  ,
const dram_allocator< U > &   
)

Equality comparison for dram_allocator.

All dram_allocator instances are considered equal.

Returns
Always returns true.

Definition at line 112 of file memory.hpp.

◆ operator==() [3/3]

template<typename T , typename U >
bool idfxx::operator== ( const spiram_allocator< T > &  ,
const spiram_allocator< U > &   
)

Equality comparison for spiram_allocator.

All spiram_allocator instances are considered equal.

Returns
Always returns true.

Definition at line 195 of file memory.hpp.