forked from bblanchon/ArduinoJson
Store static strings in a dedicated pool
Because a slot id is smaller than a pointer, this change will ultimately allow reducing the slot size.
This commit is contained in:
@ -25,8 +25,6 @@ TEST_CASE("JsonDocument::operator[]") {
|
||||
SECTION("string literal") {
|
||||
REQUIRE(doc["abc"] == "ABC");
|
||||
REQUIRE(cdoc["abc"] == "ABC");
|
||||
REQUIRE(doc["abc\0d"] == "ABCD");
|
||||
REQUIRE(cdoc["abc\0d"] == "ABCD");
|
||||
}
|
||||
|
||||
SECTION("std::string") {
|
||||
@ -114,6 +112,7 @@ TEST_CASE("JsonDocument::operator[] key storage") {
|
||||
REQUIRE(doc.as<std::string>() == "{\"hello\":0}");
|
||||
REQUIRE(spy.log() == AllocatorLog{
|
||||
Allocate(sizeofPool()),
|
||||
Allocate(sizeofStaticStringPool()),
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user