change(heap): reserve DMA pool with low priority MALLOC_CAP_DEFAULT caps

This commit is contained in:
wuzhenghui
2026-07-01 19:03:44 +08:00
parent 3abe86a894
commit 9dc97e2faf
6 changed files with 26 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -37,6 +37,11 @@ esp_err_t esp_psram_extram_add_to_heap_allocator(void);
/**
* @brief Reserve a pool of internal memory for specific DMA/internal allocations
*
* Carves out @p size bytes from the regular internal heaps and registers the
* region as separate heap pool with new priority-based caps: medium priority for
* MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL, and low priority for MALLOC_CAP_DEFAULT.
* malloc() uses the pool only after other internal heaps are exhausted.
*
* @param size Size of reserved pool in bytes
*
* @return