esp_cache_aligned_calloc() function
Helper function for calloc a cache aligned data memory buffer @deprecated This function is deprecated and will be removed in the future. Use 'heap_caps_calloc' with MALLOC_CAP_CACHE_ALIGNED caps instead
Syntax
__attribute__((deprecated("Use 'heap_caps_calloc' with MALLOC_CAP_CACHE_ALIGNED caps instead")))
esp_err_t esp_cache_aligned_calloc(size_t n,
size_t size,
uint32_t heap_caps,
void **out_ptr,
size_t *actual_size);
Arguments
n
Number of continuing chunks of memory to allocate
size
Size of one chunk, in bytes
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_calloc() calls 4 functions:
![]()
esp_cache_aligned_calloc()
esp_cache_aligned_calloc() reads 2 variables:
![]()
esp_cache_aligned_calloc()