From f1310c046bcf6adc86bb34c6d5adbc799a3fac22 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Thu, 17 Jun 2021 08:01:32 -0700 Subject: [PATCH] Make String reallocation warning more descriptive (#8131) Fixes #8130 --- cores/esp8266/WString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/WString.cpp b/cores/esp8266/WString.cpp index 2fea3bfaf..d833509a1 100644 --- a/cores/esp8266/WString.cpp +++ b/cores/esp8266/WString.cpp @@ -182,7 +182,7 @@ bool String::changeBuffer(unsigned int maxStrLen) { #ifdef DEBUG_ESP_OOM if (!isSSO() && capacity() >= OOM_STRING_THRESHOLD_REALLOC_WARN && maxStrLen > capacity()) { // warn when badly re-allocating - DEBUGV("[offending String op %d->%d ('%." STR(OOM_STRING_BORDER_DISPLAY) "s ... %." STR(OOM_STRING_BORDER_DISPLAY) "s')]\n", + DEBUGV("[String] Reallocating large String(%d -> %d bytes) '%." STR(OOM_STRING_BORDER_DISPLAY) "s ... %." STR(OOM_STRING_BORDER_DISPLAY) "s'\n", len(), maxStrLen, c_str(), len() > OOM_STRING_BORDER_DISPLAY? c_str() + std::max((int)len() - OOM_STRING_BORDER_DISPLAY, OOM_STRING_BORDER_DISPLAY): ""); }