Skip to content

Commit

Permalink
Walkable: Avoid define on 'realloc'
Browse files Browse the repository at this point in the history
  • Loading branch information
willmmiles committed Aug 5, 2024
1 parent 3a5731e commit 870fffc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/DynamicBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class Walkable

// Resize the underlying buffer storage, preserving contents
// Returns new size on success, current size on failure.
size_t realloc(size_t s) {
size_t reallocate(size_t s) {
if (s <= size()) {
auto new_buf = buffer_type(data(), s);
if (new_buf) {
Expand Down
6 changes: 3 additions & 3 deletions src/WebResponses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,17 @@ size_t AsyncAbstractResponse::_ack(AsyncWebServerRequest *request, size_t len, u
do {
dealloc_vector(_packet);
outLen = std::min(outLen, max_block_size);
_packet.realloc(outLen);
_packet.reallocate(outLen);
max_block_size = ESP.getMaxFreeBlockSize() - 128;
DEBUG_PRINTFP("(%d) Checking %d vs %d\n", (intptr_t)this, outLen, max_block_size);
} while (max_block_size < outLen);
} else {
_packet.realloc(outLen);
_packet.reallocate(outLen);
}
}
#else
//Serial.printf("[%u] %d/%d -> %d\n", (unsigned) millis(), ESP.getMaxAllocHeap(), ESP.getFreeHeap(), outLen);
_packet.realloc(outLen);
_packet.reallocate(outLen);
#endif

if(_chunked){
Expand Down

0 comments on commit 870fffc

Please sign in to comment.