Ensure xPortGetFreeHeapSize reports DRAM by mhightower83 · Pull Request #8680 · esp8266/Arduino

@mhightower83

Create dedicated function for `xPortGetFreeHeapSize()` that only reports on DRAM.

Update and export `umm_free_heap_size()` to report the free Heap space of the current Heap. Updated ESP.getFreeHeap() to use.

Replace internal function `umm_free_heap_size_lw()` with `umm_free_heap_size()`.

See umm_malloc/Notes.h entry Sep 26, 2022 for more specifics.

uncrustified `umm_poison.c`

added 2 commits

September 29, 2022 10:56
While touching and regression testing of build macros for umm_info...
and umm_stats..., improved/fixed macros for better support of
build options specified through Sketch.ino.globals.h.
Improve empty function situation around build option UMM_INFO.

@mhightower83

mcspr

@mhightower83

@mhightower83

@mcspr mcspr added this to the 3.1 milestone

Nov 2, 2022

hasenradball pushed a commit to hasenradball/Arduino that referenced this pull request

Nov 18, 2024
Create dedicated function for xPortGetFreeHeapSize() that only reports on DRAM.
NONOS SDK API system_get_free_heap_size() relies on xPortGetFreeHeapSize() for the free Heap size.

Possible breaking change for multiple Heap Sketches calling system_get_free_heap_size(); it will now always report free DRAM Heap size.

Update and export umm_free_heap_size_lw() to report the free Heap size of the current Heap.
Updated ESP.getFreeHeap() to use umm_free_heap_size_lw().

Updated build options to supply exported umm_free_heap_size_lw() via either UMM_STATS or UMM_INFO.

Improved build option support via the SketchName.ino.globals.h method for Heap options: UMM_INFO, UMM_INLINE_METRICS, UMM_STATS, UMM_STATS_FULL, UMM_BEST_FIT, and UMM_FIRST_FIT. While uncommon to change from the defaults, you can review umm_malloc_cfgport.h for more details, which may help reduce your Sketch's size in dire situations. Assuming you are willing to give up some functionality.
For debugging UMM_STATS_FULL can offer additional stats, like Heap low water mark (umm_free_heap_size_min()).