JsonArray::remove() and JsonObject::remove() now release the memory of strings

This commit is contained in:
Benoit Blanchon
2018-11-09 17:27:32 +01:00
parent e842838a23
commit f375459d53
68 changed files with 1504 additions and 740 deletions

View File

@@ -11,13 +11,15 @@ class StringMover {
public:
class StringBuilder {
public:
typedef ZeroTerminatedRamStringConst StringType;
StringBuilder(TChar** ptr) : _writePtr(ptr), _startPtr(*ptr) {}
void append(char c) {
*(*_writePtr)++ = TChar(c);
}
StringInMemoryPool complete() const {
StringType complete() const {
*(*_writePtr)++ = 0;
return reinterpret_cast<const char*>(_startPtr);
}