From 0b3c0bfe9e71a09f0931d52ce705acb2093ad772 Mon Sep 17 00:00:00 2001 From: Neil McKechnie Date: Wed, 10 Mar 2021 10:33:42 +0000 Subject: [PATCH] Update freeMemory.cpp Add explanatory comment. --- freeMemory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/freeMemory.cpp b/freeMemory.cpp index f1ad965..f640abe 100644 --- a/freeMemory.cpp +++ b/freeMemory.cpp @@ -49,6 +49,11 @@ static inline int freeMemory() { // Update low ram level. Allow for extra bytes to be specified // by estimation or inspection, that may be used by other // called subroutines. Must be called with interrupts disabled. +// +// Although __brkval may go up and down as heap memory is allocated +// and freed, this function records only the worst case encountered. +// So even if all of the heap is freed, the reported minimum free +// memory will not increase. // void updateMinimumFreeMemory(unsigned char extraBytes) { int spare = freeMemory()-extraBytes;