mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 12:10:59 +00:00
heap: Prevent alloc from IRAM to call dram_alloc_to_iram() on esp32c6 target
Since DRAM and IRAM are superposed on esp32c6 it is not necessary to convert a freshly allocated DRAM addr to its IRAM equivalent when MALLOC_CAP_EXEC is passed to heap_caps_malloc(). Instead, proceed with a default allocation since the address returned by multi_heap_malloc() already belongs to the IRAM region. Applies for esp32c6 and every boards with superposed DRAM and IRAM addresses.
This commit is contained in:
@@ -20,6 +20,16 @@ extern "C" {
|
||||
|
||||
/** The content of this file is to be kept in sync with the common section of esp_memory_utils.h **/
|
||||
|
||||
/**
|
||||
* @brief Check if the IRAM and DRAM are separate or using the same memory space
|
||||
*
|
||||
* @return true if the DRAM and IRAM are sharing the same memory space, false otherwise
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
inline static bool esp_dram_match_iram(void) {
|
||||
return (SOC_DRAM_LOW == SOC_IRAM_LOW && SOC_DRAM_HIGH == SOC_IRAM_HIGH);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if the pointer is in iram
|
||||
*
|
||||
|
Reference in New Issue
Block a user