Skip to content

Commit

Permalink
Added missing "if (umm_heap == NULL) {..." to umm_free_heap_size_lw (#…
Browse files Browse the repository at this point in the history
…6929)

also called through xPortGetFreeHeapSize, umm_free_heap_size, ...

Co-authored-by: Earle F. Philhower, III <[email protected]>
  • Loading branch information
mhightower83 and earlephilhower committed Dec 20, 2019
1 parent 52d84b1 commit 30bfdad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cores/esp8266/umm_malloc/umm_local.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ UMM_STATISTICS ummStats;

// Keep complete call path in IRAM
size_t umm_free_heap_size_lw( void ) {
if (umm_heap == NULL) {
umm_init();
}

return (size_t)ummStats.free_blocks * sizeof(umm_block);
}
#endif
Expand Down Expand Up @@ -211,5 +215,3 @@ int ICACHE_FLASH_ATTR umm_info_safe_printf_P(const char *fmt, ...) {
}

#endif // BUILD_UMM_MALLOC_C


0 comments on commit 30bfdad

Please sign in to comment.