MCPcopy Create free account
hub / github.com/bblanchon/ArduinoJson / resize

Function resize

src/ArduinoJson/Memory/StringNode.hpp:49–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 1

resizeStringMethod · 0.85

Calls 3

sizeForLengthFunction · 0.85
reallocateMethod · 0.45
deallocateMethod · 0.45

Tested by

no test coverage detected