mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-25 01:41:43 +00:00
fix(heap): Wrong address calculation in heap_caps_free
Make sure that DRAM != IRAM before getting the DRAM address from a IRAM allocation.
This commit is contained in:
@@ -27,12 +27,21 @@ extern "C" {
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
inline static bool esp_dram_match_iram(void) {
|
||||
bool dram_match_iram = (SOC_DRAM_LOW == SOC_IRAM_LOW) &&
|
||||
(SOC_DRAM_HIGH == SOC_IRAM_HIGH);
|
||||
return ((SOC_DRAM_LOW == SOC_IRAM_LOW) && (SOC_DRAM_HIGH == SOC_IRAM_HIGH));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if the RTC IRAM and RTC DRAM are separate or using the same memory space
|
||||
*
|
||||
* @return true if the RTC DRAM and RTC IRAM are sharing the same memory space, false otherwise
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
inline static bool esp_rtc_dram_match_rtc_iram(void) {
|
||||
#if SOC_RTC_FAST_MEM_SUPPORTED
|
||||
dram_match_iram &= (SOC_RTC_IRAM_LOW == SOC_RTC_DRAM_LOW);
|
||||
return ((SOC_RTC_IRAM_LOW == SOC_RTC_DRAM_LOW) && (SOC_RTC_IRAM_HIGH == SOC_RTC_DRAM_HIGH));
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
return dram_match_iram;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user