From 69fb15d3cba082e58291903fdf07080639507f30 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:06:57 +0200 Subject: [PATCH] debug message optimizations for 8266 as discussed in previous commit. --- wled00/FX_fcn.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 9a3a4ded..071c0b38 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -190,7 +190,11 @@ void Segment::deallocateData() { if ((Segment::getUsedSegmentData() > 0) && (_dataLen > 0)) { // check that we don't have a dangling / inconsistent data pointer free(data); } else { - DEBUG_PRINTF("---- Released data (%p): inconsistent UsedSegmentData (%d/%d), cowardly refusing to free nothing.\n", this, _dataLen, Segment::getUsedSegmentData()); + DEBUG_PRINT(F("---- Released data ")); + DEBUG_PRINTF("(%p): ", this); + DEBUG_PRINT(F("inconsistent UsedSegmentData ")); + DEBUG_PRINTF("(%d/%d), ", _dataLen, Segment::getUsedSegmentData()); + DEBUG_PRINTLN(F("cowardly refusing to free nothing.")); } data = nullptr; // WARNING it looks like we have a memory leak somewhere @@ -370,7 +374,7 @@ uint16_t Segment::progress() { void Segment::swapSegenv(tmpsegd_t &tmpSeg) { if (!_t) return; //DEBUG_PRINTF("-- Saving temp seg: %p (%p)\n", this, tmpSeg); - if (nullptr == &tmpSeg) { DEBUG_PRINTLN(F("swapSegenv(): tmpSeg is nullptr !!")); return; } // sanity check + // if (nullptr == &tmpSeg) { DEBUG_PRINTLN(F("swapSegenv(): tmpSeg is nullptr !!")); return; } // sanity check - should not happen as references cannot be NULL in C++ tmpSeg._optionsT = options; for (size_t i=0; i_segT) != &tmpSeg) { // update possibly changed variables to keep old effect running correctly _t->_segT._aux0T = aux0;