Heap init code improvements and updates by mhightower83 · Pull Request #8458 · esp8266/Arduino (original) (raw)

Moved secondary heap init code to flash.

  External -24 IRAM, +32 IROM
  IRAM     -76 IRAM, +64 IROM

General updates to umm_init call path and defines to better align with upstream. Name changes: UMM_INIT_HEAP with UMM_CHECK_INITIALIZED, umm_init_stage_2 with _umm_init_heap, and umm_init_common with umm_init_heap.

Add file umm_cfgport.h to hold port-specific values. Stay focused on heap initialization only move-related defines.

Improved comments.

Created a wrapper function for running pre-SDK code from flash.
Updated hwdt_app_entry to use it.

Update umm_init with the option to run from ICACHE.
Added build define UMM_INIT_USE_ICACHE to move umm_init call path to flash.
Added build define UMM_INIT_USE_IRAM to move umm_init call path back to IRAM.
Using ICACHE frees up 160 bytes of IRAM at a cost of 208 bytes of IROM.

Defaults to no change, umm_init call path will be in IRAM.
Defaults with umm_init call path in ICACHE.