Skip to content

Commit

Permalink
Make String reallocation warning more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
earlephilhower committed Jun 17, 2021
1 parent e8b411f commit 21c587f
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 21c587f

Please sign in to comment.