diff --git a/src/ArduinoJson/Memory/StringNode.hpp b/src/ArduinoJson/Memory/StringNode.hpp index 4f35e492..88979cd7 100644 --- a/src/ArduinoJson/Memory/StringNode.hpp +++ b/src/ArduinoJson/Memory/StringNode.hpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include // offsetof @@ -15,9 +16,13 @@ ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE struct StringNode { + // Use the same type as SlotId to store the reference count + // (there can never be more references than slots) + using references_type = uint_t::type; + struct StringNode* next; uint16_t length; - uint16_t references; + references_type references; char data[1]; static constexpr size_t maxLength = numeric_limits::highest();