forked from bblanchon/ArduinoJson
Avoid pool reallocation in BasicJsonDocument
's copy assignment
This commit is contained in:
@ -139,6 +139,9 @@ class BasicJsonDocument : AllocatorOwner<TAllocator>, public JsonDocument {
|
||||
}
|
||||
|
||||
void reallocPool(size_t requiredSize) {
|
||||
size_t capa = addPadding(requiredSize);
|
||||
if (capa == _pool.capacity())
|
||||
return;
|
||||
freePool();
|
||||
replacePool(allocPool(addPadding(requiredSize)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user