esp_cache_aligned_malloc() function
Helper function for malloc a cache aligned data memory buffer @deprecated This function is deprecated and will be removed in the future. Use 'heap_caps_malloc' with MALLOC_CAP_CACHE_ALIGNED caps instead
Syntax
__attribute__((deprecated("Use 'heap_caps_malloc' with MALLOC_CAP_CACHE_ALIGNED caps instead")))
esp_err_t esp_cache_aligned_malloc(size_t size,
uint32_t heap_caps,
void **out_ptr,
size_t *actual_size);
Arguments
size
Size in bytes, the amount of memory to allocate
heap_caps
Flags, see `MALLOC_CAP_x`
out_ptr
A pointer to the memory allocated successfully
actual_size
Actual size for allocation in bytes, when the size you specified doesn't meet the cache alignment requirements, this value might be bigger than the size you specified. Set null if you don't care this value.
Return value
- ESP_OK: - ESP_ERR_INVALID_ARG: Invalid argument - ESP_ERR_NO_MEM: No enough memory for allocation
Notes
Now only support 'MALLOC_CAP_INTERNAL', 'MALLOC_CAP_DMA' and 'MALLOC_CAP_SPIRAM'
esp_cache_aligned_malloc() calls 1 function:
![]()
esp_cache_aligned_malloc()
esp_cache_aligned_malloc():
![]()
esp_cache_aligned_malloc()