CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC vs CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC
CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC vs CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC
What is the difference between CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC and CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC? This doesn't seem to be explained anywhere.
-
- Posts: 1707
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC vs CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC
The help text in menuconfig for "Memory allocation strategy" describes the strategies:
"Internal DRAM memory only" vs. "Either internal or external memory based on default malloc() behavior in ESP-IDF"
"Internal DRAM memory only" vs. "Either internal or external memory based on default malloc() behavior in ESP-IDF"
Re: CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC vs CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC
Unfortunately, Espressif has broken the help text for menuconfig in vscode plugin, so that information is unavailable to me. That said, even that description tells us nothing. It doesn't explain why internal is actually the default, and what the behavior is in default mode. It's been said elsewhere that default results in static memory allocation, but I'm unable to substantiate that claim.MicroController wrote: ↑Wed Feb 14, 2024 1:45 pmThe help text in menuconfig for "Memory allocation strategy" describes the strategies:
"Internal DRAM memory only" vs. "Either internal or external memory based on default malloc() behavior in ESP-IDF"
-
- Posts: 1707
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC vs CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC
True. To understand what the options actually mean you have to know about the 'capabilities-based' heap allocator and that you can globally configure malloc's behavior in the IDF: https://docs.espressif.com/projects/esp ... via-mallocIt doesn't explain why internal is actually the default, and what the behavior is in default mode.
TL;DR: Code (like mbedtls) can explicitly force allocations to internal (or external) RAM by using the capabilities-based allocator API; or the code can just use standard malloc() which may allocate in internal or external RAM depending on how the global CONFIG_SPIRAM_USE is set.
Who is online
Users browsing this forum: No registered users and 116 guests