From 765d70b88de4d96f009ceadc00a4e0b9416d4bb5 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Tue, 26 May 2020 11:51:52 -0700 Subject: [PATCH] Document ESP.getMaxFreeBlockSize() != max malloc size Fixes #7322. Because of UMM internals, the largest `malloc()`able block will be smaller than the largest contiguous free RAM block. Note in the docs. --- doc/libraries.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/libraries.rst b/doc/libraries.rst index 8e8bdcb637..87130c702d 100644 --- a/doc/libraries.rst +++ b/doc/libraries.rst @@ -87,7 +87,7 @@ Some ESP-specific APIs related to deep sleep, RTC and flash memories are availab ``ESP.getHeapFragmentation()`` returns the fragmentation metric (0% is clean, more than ~50% is not harmless) -``ESP.getMaxFreeBlockSize()`` returns the maximum allocatable ram block regarding heap fragmentation +``ESP.getMaxFreeBlockSize()`` returns the largest contiguous free RAM block in the heap, useful for checking heap fragmentation. **NOTE:** Maximum ``malloc()``able block will be smaller due to memory manager overheads. ``ESP.getChipId()`` returns the ESP8266 chip ID as a 32-bit integer.