template<typename T = uint8_t>
class esp_h264::RAMAllocatorH264< T >
STL-compatible allocator that uses internal RAM (DRAM) allocation.
RAMAllocatorH264 is a custom C++ allocator that allocates memory from internal DRAM using heap_caps_aligned_calloc with MALLOC_CAP_INTERNAL. This ensures allocation from fast internal memory rather than external PSRAM.
This allocator is useful for ESP32 platforms when you specifically want small, frequently-accessed buffers to be stored in fast internal RAM rather than slower external PSRAM.
- Template Parameters
-
| T | The type of objects to allocate |
- Note
- On ESP-IDF platforms, uses heap_caps_aligned_calloc for internal RAM allocation
-
On Arduino platforms, the heap_caps functions are shimmed to standard malloc/free
-
Memory is zero-initialized (calloc behavior)
-
Provides proper alignment for the allocated type
Example usage:
std::vector<uint32_t, RAMAllocatorH264<uint32_t>> smallBuffer;
smallBuffer.resize(256);
fastBuffer.resize(256);
Header-only C++ allocator that uses internal RAM (DRAM) on ESP32.
std::vector< T, RAMAllocatorH264< T > > RAMVec
Convenience type alias for vectors using RAMAllocatorH264.
Definition: RAMAllocatorH264.h:150