| 47 | } |
| 48 | |
| 49 | static StringNode* resize(StringNode* node, size_t length, |
| 50 | Allocator* allocator) { |
| 51 | ARDUINOJSON_ASSERT(node != nullptr); |
| 52 | StringNode* newNode; |
| 53 | if (length <= maxLength) |
| 54 | newNode = reinterpret_cast<StringNode*>( |
| 55 | allocator->reallocate(node, sizeForLength(length))); |
| 56 | else |
| 57 | newNode = nullptr; |
| 58 | if (newNode) |
| 59 | newNode->length = length_type(length); |
| 60 | else |
| 61 | allocator->deallocate(node); |
| 62 | return newNode; |
| 63 | } |
| 64 | |
| 65 | static void destroy(StringNode* node, Allocator* allocator) { |
| 66 | allocator->deallocate(node); |
no test coverage detected