mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat(bt): Frees BLE memory when no longer in use
It will free libble.a & libbt all txt, data and bss segment memory. This memory is combined into one large memory and put into the heap pool.
This commit is contained in:
@@ -113,7 +113,10 @@ extern int _bss_start;
|
||||
extern int _bss_end;
|
||||
extern int _rtc_bss_start;
|
||||
extern int _rtc_bss_end;
|
||||
|
||||
#if CONFIG_BT_LE_RELEASE_IRAM_SUPPORTED
|
||||
extern int _bss_bt_start;
|
||||
extern int _bss_bt_end;
|
||||
#endif // CONFIG_BT_LE_RELEASE_IRAM_SUPPORTED
|
||||
extern int _instruction_reserved_start;
|
||||
extern int _instruction_reserved_end;
|
||||
extern int _rodata_reserved_start;
|
||||
@@ -415,6 +418,11 @@ void IRAM_ATTR call_start_cpu0(void)
|
||||
//Clear BSS. Please do not attempt to do any complex stuff (like early logging) before this.
|
||||
memset(&_bss_start, 0, (&_bss_end - &_bss_start) * sizeof(_bss_start));
|
||||
|
||||
#if CONFIG_BT_LE_RELEASE_IRAM_SUPPORTED
|
||||
// Clear Bluetooth bss
|
||||
memset(&_bss_bt_start, 0, (&_bss_bt_end - &_bss_bt_start) * sizeof(_bss_bt_start));
|
||||
#endif // CONFIG_BT_LE_RELEASE_IRAM_SUPPORTED
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32) && defined(CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY)
|
||||
// Clear IRAM BSS
|
||||
memset(&_iram_bss_start, 0, (&_iram_bss_end - &_iram_bss_start) * sizeof(_iram_bss_start));
|
||||
|
||||
Reference in New Issue
Block a user