Skip to content

Commit

Permalink
Make String reallocation warning more descriptive (#8131)
Browse files Browse the repository at this point in the history
Fixes #8130
  • Loading branch information
earlephilhower authored Jun 17, 2021
1 parent 52be27d commit f1310c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cores/esp8266/WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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): "");
}
Expand Down

0 comments on commit f1310c0

Please sign in to comment.