docs: clarify PSRAM default allocation behavior

Clarify that MALLOC_CAP_DEFAULT describes a memory capability
rather than the malloc() placement policy, so PSRAM-backed
capability allocations are documented correctly when malloc()
remains internal-only by default.

Closes https://github.com/espressif/esp-idf/issues/18391

Made-with: Cursor
This commit is contained in:
Marius Vikhammer
2026-03-25 15:35:21 +08:00
parent 34b7749eda
commit c1256efd67
5 changed files with 32 additions and 7 deletions
+10 -1
View File
@@ -71,7 +71,16 @@ choice SPIRAM_USE
config SPIRAM_USE_MEMMAP
bool "Integrate RAM into memory map"
config SPIRAM_USE_CAPS_ALLOC
bool "Make RAM allocatable using heap_caps_malloc(..., MALLOC_CAP_SPIRAM)"
bool "Add RAM to heap_caps allocator (malloc() stays internal by default)"
help
Add SPI RAM to the capability allocator.
Use heap_caps_malloc(..., MALLOC_CAP_SPIRAM) to explicitly allocate
from SPI RAM. SPI RAM may also be returned by
heap_caps_malloc(..., MALLOC_CAP_DEFAULT), since this heap is also
registered with MALLOC_CAP_DEFAULT.
Standard malloc() does not allocate from SPI RAM by default in this mode.
config SPIRAM_USE_MALLOC
bool "Make RAM allocatable using malloc() as well"
select FREERTOS_SUPPORT_STATIC_ALLOCATION