Restored the monotonic allocator

This commit is contained in:
Benoit Blanchon
2018-11-30 14:27:33 +01:00
parent 637f7a5bfa
commit 45f4e5ac20
23 changed files with 35 additions and 609 deletions

View File

@ -22,17 +22,4 @@ TEST_CASE("JsonObject::createNestedObject()") {
obj.createNestedObject(vla);
}
#endif
SECTION("releases memory from nested object") {
obj.createNestedObject(std::string("a"))
.createNestedObject(std::string("b"))
.set(std::string("c"))
.set(1);
// {"a":{"b":{"c":1}}}
REQUIRE(doc.memoryUsage() ==
3 * JSON_OBJECT_SIZE(1) + 3 * JSON_STRING_SIZE(2));
obj.createNestedObject(std::string("a"));
REQUIRE(doc.memoryUsage() == JSON_OBJECT_SIZE(1) + JSON_STRING_SIZE(2));
}
}